Comments (9)
a workaround is to use Random.id()
to set the value for _id
before calling insert. In this case the id
parameter is filled with the correct value. Here is an example:
var newTeam = {
_id: Random.id(),
owner: Meteor.userId(),
members: teamMembers,
date: new Date()
};
Teams.insert(newTeam, function(err, _id) {
if (!err) {
WorkEntry.insert({
team: _id,
workEntries: []
});
....
from ground-db.
Umm, seems strange, its just regular meteor.collection
from ground-db.
Btw. I'll have a closer look at this package soon - I'm finalizing a project where I created a very small offline db that stores in both local storage and on a S3 server (its a package Meteor client only app in cordova auth via Facebook)
This will be part of v2 of GroundDB
from ground-db.
Thanks @drgorb the workaround seems to work great. Did not know that the _id could be set in advance, this must be a new(ish) feature in Meteor.
from ground-db.
@drgorb seems to be a workaround for #34 as well.
from ground-db.
still a strange issue :) it should be basic meteor. could you try the new ground:db? @drgorb I've refactored so it uses async localstorage adapter - but we could in theory create a package for an other adapter and have grounddb use that instead.
from ground-db.
please test this issue with ground:db at v0.0.3
from ground-db.
Cant meteor publish
at the moment... Waiting for mdg
from ground-db.
Tracking it in #48
from ground-db.
Related Issues (20)
- Ionic2/Angular2 support? HOT 4
- Auto cleanup as data grows HOT 2
- React native support HOT 1
- wait for all inserts done HOT 1
- MongoId strings not returning. HOT 5
- Status of package HOT 6
- GroundDB on Meteor Unable to handle file size >= 5MB HOT 4
- Unclear on how to use version 2 HOT 2
- Using pendingReads & pendingWrites HOT 1
- .observeSource is not a function HOT 3
- groundDB: how to add another database?
- Sometimes getting back undefined HOT 1
- Can't get reactive vars
- GroundDB with Meteor + PostgresSQL HOT 2
- Updating Grounded Collection + syncing with server
- loadDatabase not working
- Remove is inconsistent HOT 2
- Moving to Meteor Community HOT 17
- GroundDB doesn't sync data to live server when getting online again after a while HOT 2
- ReferenceError: EventState is not defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ground-db.