We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Also happens with db.rel.find(type, ids). If you take the example from readme:
var db = new PouchDB('mydb'); db.setSchema([ {singular: 'author', plural: 'authors', relations: { books: {hasMany: 'book'}}}, {singular: 'book', plural: 'books', relations: {author: {belongsTo: 'author'}}} ]); db.rel.save('author', { name: 'George R. R. Martin', id: 1, books: [6, 7] }).then(function () { return db.rel.save('book', { title: 'A Game of Thrones', id: 6, author: 1}); }).then(function () { return db.rel.save('book', {title: 'The Hedge Knight', id: 7, author: 1}); }).catch(console.log.bind(console));
And then you want find book with id 7:
db.rel.find('book',7).then(function(doc){ console.log(doc); });
You got as result all books:
{ "books" : [ { "title" : "A Game of Thrones", "author" : 1, "id" : 6, "rev" : "1-16ce4f20eae39bd0655f00f81973dd14" }, { "title" : "The Hedge Knight", "author" : 1, "id" : 7, "rev" : "1-7d35db00e3b7df172e33173eded5ab72" } ], "authors" : [ { "name" : "George R. R. Martin", "books" : [ 6, 7 ], "id" : 1, "rev" : "1-c4c9b023321d67787d737421837988e3" } ] }
The text was updated successfully, but these errors were encountered:
Thanks for reporting! This is actually by design; you can omit dependent objects by using async relations: https://github.com/nolanlawson/relational-pouch#async-relationships
Sorry, something went wrong.
No branches or pull requests
Also happens with db.rel.find(type, ids). If you take the example from readme:
And then you want find book with id 7:
You got as result all books:
The text was updated successfully, but these errors were encountered: