Meteor-Community-Packages / Meteor-Community-Packages/ground-db
problem inserting on client only db
- Dominant language
- JavaScript
- Stars
- 569
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
Thanks for making this package @Raix, I'm still always surprised by how many packages you're running.
Here's my problem, I've defined a ground db this way:
```
GroundSubs = new Ground.Collection('submissions', {conection: null});
```
and am trying to insert this way on the dev console getting the following error (note: I have zones.js on giving a pretty exhaustive stack trace):
```
GroundSubs.insert({test:"test"})
"EHcZKeymZCgPQPzfy"
reporters.js?1440795872491:67 Error: insert failed: Method not found
> Before: 176ms (diff: 176ms)
at applyHook [as apply] (http://meteor.local/packages/ground_db.js?cf9d0a41470603cdf75f74faa82fb1a04b52340f:1022:30)
at Mongo.Collection.(anonymous function) (http://meteor.local/packages/mongo.js?3cfe0c5981c197df33036a37574850f057e934a6:656:26)
at Mongo.Collection.(anonymous function) [as insert] (http://meteor.local/packages/aldeed_collection2.js?a0502e6da57755591b47aa04c532a32d3ecf4605:222:23)
at _groundUtil.Collection.insert (http://meteor.local/packages/ground_db.js?cf9d0a41470603cdf75f74faa82fb1a04b52340f:1116:17)
at null. (http://meteor.local/packages/matb33_collection-hooks.js?84a1c8cf4708b40e4c95f8e059ef1a0bdb5f5897:328:18)
at collection.(anonymous function) [as insert] (http://meteor.local/packages/matb33_collection-hooks.js?84a1c8cf4708b40e4c95f8e059ef1a0bdb5f5897:143:21)
```
I realize I haven't subscribed/published/dealt with permissions, but it isn't clear to me how to do this on the client.
I also noticed the tests in groundDB.client.tests.js on line 55 which resembles this case don't do anything fancy like permissions, but it's also commented out.
Contributor guide
Research direction
Reproduce the client-console insert using the Ground.Collection setup shown in the issue, then inspect groundDB.client.tests.js around line 55 and the insert path named in the stack trace. Determine the expected behavior for a client-only collection and document or fix the behavior so the relevant client test verifies it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100