Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Be able to have local only collection #341

Open
schlaegerz opened this issue Jun 14, 2019 · 0 comments
Open

[REQUEST] Be able to have local only collection #341

schlaegerz opened this issue Jun 14, 2019 · 0 comments

Comments

@schlaegerz
Copy link

I have a case where I want to keep some data locally and it is much easier for various reasons if it is a mongo collection from Meteor, I do this on web with meteor so it should be easily possible to do it with this package.

On web when you create a new mongo collection
new Mongo.Collection(null, {connection: null})
Either passing no name, or passing 'connection:null' will result in it being a local only collection.

Right now if you were to make this collection all the items get removed after a short time out due to trying to insert it in a server collection.

My suggested change is to check mark it as a local connection in the case where you don't pass a name, and then skip the ddp calls in the insert/update/remove functions.

Temporary workaround I found is I can call:
myCollection._collection.upsert({_id: data._id}, {$set:data})
Which skips all the ddp logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant