Skip to content

loadDatabase not working #207

Description

@ashish979

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions