https://github.com/crufter/resolver
Automatic resolution of MongoDb foreign keys without DBRefs.
https://github.com/crufter/resolver
Last synced: 3 months 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 (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-09-14T11:52:49.000Z (almost 13 years ago)
- Last Synced: 2025-03-24T03:56:07.532Z (3 months ago)
- Language: Go
- Homepage:
- Size: 137 KB
- Stars: 2
- Watchers: 1
- 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.