Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise data array is not in a correct order. #859

Open
ronaldaug opened this issue Jul 23, 2018 · 4 comments
Open

Promise data array is not in a correct order. #859

ronaldaug opened this issue Jul 23, 2018 · 4 comments

Comments

@ronaldaug
Copy link

ronaldaug commented Jul 23, 2018

Is there any query or method that I can get the correct order of array?
If I add an item, it should store as the last item in the array. But it's not working like that. ( Probably, it's only happen at me? )

Currently, I have to reorder the array by sorting the times like this

hoodie.store.findAll().then(function (data) {
	data.sort((a,b)=>return b.createdAt - a.createdAt);
})

And one more question how do I get current username/data?
I try something like this and it just return promise.

var currentUsername = hoodie.account.get().then(function(e){
        return e.username;
})
console.log(currentUsername);

Is there any easy way to get username as a string?
Probably something like this var currentUsername = hoddie.account.get('username');
Thanks in advance.

@kragil
Copy link

kragil commented Aug 16, 2018

Hoodie is mostly dead. Move along.

@David-Carty
Copy link

Hoodie is not dead! Hoodie is an amazing concept. More people need to take this project seriously. Love it!!!

@nstudt
Copy link

nstudt commented Nov 26, 2018

I never could get my head around that project, but with no meaningful commits in the last two years, I'd agree with Kragel.
Pouchdb's Mango queries are relatively easy and will get you where you want to go. https://pouchdb.com/guides/mango-queries.html.
As an aside, assuming you are working through authentication, scotch.io has a good tutorial that you can integrate into the pouch store. https://scotch.io/tutorials/easy-node-authentication-setup-and-local.

@David-Carty
Copy link

Appreciate your feedback. I will check out those links. Got Hoodie working sweet,though, for one of my clients. So, I'm happy, he's happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants