I am trying to implement an offline DB for my meteor app and chose to use “GroundDB”. Now I am still in my early learning phases but I am having a problem for which I cannot find a solution:
when using .find on my offline-collections, I cannot find by id. Every other property works. A typical object from my mongo DB will look like this:
{_id:"…someid", name:“test”, description:“test”, systemId:"…someID"};
I can find by name, description and even systemID, but finding by _id is always giving back 0 results.
What could cause this behaviour?
This is only for GroundDB. Finding by _id in mongo database works. Also, the “_id” field in GroundDB is there! When doing a .find({})
without filters, I can see that all properties, including the _id-field, get copied to groundb.
Edit
My current code regarding groundDB looks as follows:
ExampleCol = new Mongo.Collection('exampleCol');
if (Meteor.isServer) {
Meteor.publish('exampleCol', functionexampleColPublication() {
return ExampleCol.find();
});
}
On Client:
ExampleCol_GROUND = new Ground.Collection('exampleCol'
});
ExampleCol_GROUND.observeSource(ExampleCol.find());
And then:
ExampleCol_GROUND.find()
returns all entries, that are also in ExampleCol. I just cannot ExampleCol_GROUND.find({_id:"..."})
(0 results)