Meteor-Community-Packages / Meteor-Community-Packages/ground-db
Collection Helpers
- Dominant language
- JavaScript
- Stars
- 569
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
I'm completely new to ground:db and grounded succesfully my database in a cordova app. The app only needs to read, no operations to the database are needed. But I'm using a lot of Collection Helpers (dburles:collection-helpers [)](https://github.com/dburles/meteor-collection-helpers) which can't be accessed when grounded (says they are not defined), because the functions aren't attached to the object returned when taken frome the grounded collection. Also I can't attach Collection Helpers to Ground.Collection (says GroundedCollection.helpers is not defined).
``` javascript
export const Artworks = new Mongo.Collection('artworks');
if(Meteor.isCordova){
const ArtworksGround = new Ground.Collection(' ArtworksGround');
ArtworksGround.observeSource(Artworks.find());
Meteor.subscribe('artworks.all');
Artworks.find = function(...args) {
return ArtworksGround.find(...args);
};
Artworks.findOne = function(...args) {
return ArtworksGround.findOne(...args);
};
}
Artworks.helpers({
helperFunction() {
// do something...
return something;
}
});
```
I know this problem is connected with the other package but I thought it would be likelier somebody around here knows a workaround for this.
Contributor guide
Research direction
Start with the Ground.Collection, observeSource, find, and findOne usage shown in the issue, then compare the returned objects with the dburles:collection-helpers integration. Check whether Ground.Collection exposes a helpers entry point or preserves helper methods; done means identifying a supported workaround or clearly documenting the incompatibility.
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