https://github.com/tomitrescak/apollo-passport-mongodb
MongoDB Native driver for passport
https://github.com/tomitrescak/apollo-passport-mongodb
Last synced: 2 months ago
JSON representation
MongoDB Native driver for passport
- Host: GitHub
- URL: https://github.com/tomitrescak/apollo-passport-mongodb
- Owner: tomitrescak
- License: mit
- Created: 2016-08-22T04:37:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-22T05:14:44.000Z (almost 9 years ago)
- Last Synced: 2025-03-10T15:17:39.259Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# apollo-passport-mongodb
MongoDB native driver for apollo-passport
[](https://www.npmjs.com/package/apollo-passport-mongodb) [](https://circleci.com/gh/tomitrescak/apollo-passport-mongodb) [](https://coveralls.io/github/tomitrescak/apollo-passport-mongodb?branch=master) 
Copyright (c) 2016 by Tomas Trescak, released under the MIT license.
## Usage
```js
import { MongoClient } from 'mongodb';
import MongoDriver from './index';// However you usually create your mongodb instance
const m = await MongoClient.connect(`mongodb://${host}:${port}/${name}`);// Pass to apollo passport at creation time
const apolloPassport = new ApolloPassport({
// along with any other relevant options
db: new MongoDriver(m)
});
```**Optional parameters**, e.g. if your `users` table is called something else:
```js
new MongoDriver(r, {
userTableName: 'users',
configTableName: 'apolloPassportConfig',
db: '(override default database given to mongo)'
});
```See [apollo-passport](https://github.com/apollo-passport/apollo-passport) for more info.
## Create your own DBDriver
This package is fully documented with 100% test coverage. It can be used as a basis for creating other DBDrivers for Apollo Passport.
See also the [API Docs](docs/api/apollo-passport-rethinkdbdash), ordered by version and viewable online via rawgit, e.g. [v0.0.2 API Docs on RawGit](https://cdn.rawgit.com/apollo-passport/rethinkdbdash/master/docs/api/apollo-passport-rethinkdbdash/0.0.2/RethinkDBDashDriver.html).