ground-db icon indicating copy to clipboard operation
ground-db copied to clipboard

ok to use Mongos ObjectID?

Open JayMc opened this issue 10 years ago • 4 comments

This could be my app but when creating documents with Mongos ObjectID they will not be retrieved next time the app is started in offline mode.

lists.insert({'_id':new Mongo.Collection.ObjectID(),'name':name});

This doesn't seem to be an issue when not specifying the id:

lists.insert({'name':name})

In both cases Local storage saves the doc ids as strings, for ObjectID an extra element called _str is added. Maybe I shouldn't be using Mongo IDs in my Meteor apps?

JayMc avatar Feb 22 '15 08:02 JayMc

Not sure if this is a ground db issue - Does that work with regular Meteor.Collection? Use Random.id() for id generation if you need to. (the insert returns the id)

raix avatar Feb 22 '15 12:02 raix

I've a similar issue, related to ObjectID. My app was working properly. I added GroundDB and replaced my Mongo.Collection to Ground.Collection. Since, I see hundreds of « Meteor does not currently support objects other than ObjectID as ids » in my console, each time a restart the app.

sapiens-sapide avatar Aug 06 '15 06:08 sapiens-sapide

Patch 8f9c1 on minimax project fix my issue. Do you plan to include this patch in next release ? Thanks.

sapiens-sapide avatar Aug 07 '15 06:08 sapiens-sapide

I have the exact same issue:

colMessages = new Meteor.Collection('messages' ,{idGeneration:'MONGO'});

  • this works perfectly and throws no issues or errors

colMessages = new Ground.Collection('messages' ,{idGeneration:'MONGO'});

  • I get inundated in the client console log with "Uncaught Error: Meteor does not currently support objects other than ObjectID as ids"

the console messages are all attributed to app/packages/mongo-id/id.js:73 My application still works absolutely fine though - just the (many) annoying console messages

andrewlorenz avatar Oct 02 '15 13:10 andrewlorenz