Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crufter/resolver
Automatic resolution of MongoDb foreign keys without DBRefs.
https://github.com/crufter/resolver
Last synced: 22 days ago
JSON representation
Automatic resolution of MongoDb foreign keys without DBRefs.
- Host: GitHub
- URL: https://github.com/crufter/resolver
- Owner: crufter
- Created: 2012-07-05T13:35:57.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-09-14T11:52:49.000Z (over 12 years ago)
- Last Synced: 2024-11-30T21:48:47.342Z (23 days ago)
- Language: Go
- Homepage:
- Size: 137 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
resolver
========Mongodb database references without DBRefs, and automatic resolution of them.
What does it do?
========
You pass in a *mgo.Database (db) and a query result (v) to
```
resolver.Resolve(db, v, nil)
```And this package will resolve all "foreign key references" which value is an instance of bson.ObjectId, and which key has the form of:
```
"_collName"
// or
"_collName_customFieldName" // In case of there are more than one reference to a given collection in a document.
```The value can be a single bson.ObjectId or a []bson.ObjectId.