Skip to content

Commit

Permalink
Merge pull request #91 from msenevir/fix-readme-typo
Browse files Browse the repository at this point in the history
fix typo in documentation for db.rel.findHasMany
  • Loading branch information
broerse authored Jan 12, 2018
2 parents 5ca9320 + 895aefc commit d925fd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ API
* [`db.rel.parseDocID(docID)`](#dbrelparsedociddocid)
* [`db.rel.makeDocID(docID)`](#dbrelmakedocidparsedid)
* [`db.rel.parseRelDocs(type, pouchDocs)`](#dbrelparsereldocstype-pouchdocs)
* [`db.rel.findHasMany(type, type, belongsToKey, belongsToId)`](#dbrelfindhasmanytype-belongstokey-belongstoid)
* [`db.rel.findHasMany(type, belongsToKey, belongsToId)`](#dbrelfindhasmanytype-belongstokey-belongstoid)
* [`db.rel.isDeleted(type, id)`](#dbrelisdeletedtype-id)
* [Managing relationships](#managing-relationships)
* [One-to-one](#one-to-one-relationships)
Expand Down Expand Up @@ -918,9 +918,9 @@ db.setSchema([
```
This will tell relational-pouch to not save the book ids on the author, and use a query using db.find to look for the related books.
Since this uses [`db.rel.findHasMany(type, type, belongsToKey, belongsToId)`](#dbrelfindhasmanytype-belongstokey-belongstoid) internally, you also need an index as specified there, where `belongsToKey` is the field specified in the `queryInverse` option.
Since this uses [`db.rel.findHasMany(type, belongsToKey, belongsToId)`](#dbrelfindhasmanytype-belongstokey-belongstoid) internally, you also need an index as specified there, where `belongsToKey` is the field specified in the `queryInverse` option.
For async relations this queryInverse will not work at this moment and the child id array will not be present on the result. You can use the [`db.rel.findHasMany(type, type, belongsToKey, belongsToId)`](#dbrelfindhasmanytype-belongstokey-belongstoid) for this scenario instead.
For async relations this queryInverse will not work at this moment and the child id array will not be present on the result. You can use the [`db.rel.findHasMany(type, belongsToKey, belongsToId)`](#dbrelfindhasmanytype-belongstokey-belongstoid) for this scenario instead.
If you also don't give relational-pouch the child ids when calling db.rel.save you could also completely remove the hasMany side of the relation from the schema .
#### Advanced
Expand Down

0 comments on commit d925fd1

Please sign in to comment.