Meteor-Community-Packages / Meteor-Community-Packages/ground-db
ok to use Mongos ObjectID?
- Dominant language
- JavaScript
- Stars
- 569
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
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.
``` javascript
lists.insert({'_id':new Mongo.Collection.ObjectID(),'name':name});
```
This doesn't seem to be an issue when not specifying the id:
``` javascript
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?
Contributor guide
Research direction
Start by reproducing the issue with the two lists.insert examples, then inspect how Mongo.Collection.ObjectID values are serialized into local storage and restored after an offline restart. Done means documents created with an ObjectID are retrieved across restarts, while documents without an explicit id continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100