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

loadDatabase not working #207

Open
ashish979 opened this issue Jan 30, 2018 · 0 comments
Open

loadDatabase not working #207

ashish979 opened this issue Jan 30, 2018 · 0 comments
Labels

Comments

@ashish979
Copy link

ashish979 commented Jan 30, 2018

Hi @raix

I am using groundDb in an exiting application.
Right now I am simply trying to ground Meteor.users:

GroundedUsers = new Ground.Collection("Meteor.users")
GroundedUsers.observeSource(Meteor.users.find())
if Meteor.isCordova && Meteor.status() != 'connected'
  GroundedUsers.loadDatabase()

The above did not work.
So, I tried overriding find and findOne method:

Meteor.users.find = (args...) ->
    GroundedUsers.find(args...)
Meteor.users.findOne = (args...) ->
    GroundedUsers.findOne(args...)

Now, Meteor.users.find({_id: Meteor.userId()}).fetch() should return a document but it returns a plain object. I have apply Collection._transform to transform it into a document.

If loadDatabase() would be working, I should not have to do the same.

PS: Above code is written in coffeescript.

Any help would be nice.

Thanks

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

No branches or pull requests

2 participants