Comments (7)
I seem to be able to make progress by defining an explicity by_collection filter in the design doc:
function(doc, req) {
if (doc.collection) {
emit(doc.collection, doc);
}
}
from backbone-couchdb.
Sure, there needs to be a filter function with that name.
If you're using the couchapp tool, you could easily copy one of the examples and add your own code.
Do you still get the 404 errors?
from backbone-couchdb.
Hi Jan, I think adding the explicit filter function above cured the problem (I did: 'couchapp generate by_collection'). Thanks!
Closing and leaving for posterity.
from backbone-couchdb.
I think the filter function should be something like:
function(doc, req) {
if (doc.QUERY_VAR && doc.QUERY_VAR==req.query.QUERY_VAR)
return true;
else
return false;
}
At least, that is what worked for me.
from backbone-couchdb.
Did https://github.com/janmonschke/backbone-couchdb/blob/master/comments_example/filters/by_collection.js not work for you?
from backbone-couchdb.
Ahh, I did not see that. Thank you. Do you think it would it be worth it to put that function in the main docs?
from backbone-couchdb.
Maybe I should add it to the overall README of the project.
from backbone-couchdb.
Related Issues (20)
- bycollection view should probably return doc_.id instead of doc HOT 5
- Support for deletion changes? HOT 3
- Possibility to pass include_docs when reading from views HOT 4
- Unpatched Backbone.Model still remians in Backbone.Collection::model HOT 2
- Objects returned by Model.clone() contain _id and _rev attributes of the cloned object HOT 1
- fetch method on collection not returning deferred object HOT 6
- just bumped into bb-cdb again today HOT 2
- Add the option to use lists and shows HOT 2
- jquery.couch.js in README defunct HOT 1
- Question about views and filters HOT 1
- Support CouchDB _updates HOT 3
- Compatibility with backbone-relational.js HOT 1
- Register Bower Package HOT 1
- I don't think doc.doc is what is needed during a fetch
- Undeclared variable error in error handler HOT 5
- Add support for backbone 0.9.9 HOT 1
- Accept doc.key instead of doc.value for group-by/distinct mapreduce views
- Fetch does not return XHR
- Need a way to get a single model by a non-ID attrib
- License file
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 backbone-couchdb.