So given a database with types of post, comment, user, how would I get back a few posts, with their comments, and with the comment posters full name (which is in a separate document)?
Also, with regards to the originally documented trick to return both custom and order documents:
function(doc) {
if (doc.Type == "customer") {
emit([doc._id, 0], doc);
} else if (doc.Type == "order") {
emit([doc.customer_id, 1], doc);
}
}
From my understanding, imposing a count limit on this doesn't
discriminate between customers or orders, just total rows returned
from the view. So how would I say, give me back 5 customers with their
orders? Or even, give me back 10 customers with their last 5 orders?
Cheers, Ben
smime.p7s
Description: S/MIME cryptographic signature
