This package has been deprecated

Author message:

All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/adapter-mongoose": "^5.0.0" and update any require/import statements in your code.

@keystone-alpha/adapter-mongoose

6.0.1 • Public • Published

Mongoose Database Adapter

Usage

const { MongooseAdapter } = require('@keystone-alpha/adapter-mongoose');

const keystone = new Keystone({
  name: 'My Awesome Project',
  adapter: new MongooseAdapter(),
});

API new MongooseAdapter(options)

options.mongoUri (optional)

This is used as the uri parameter for mongoose.connect().

Default: Environmental variable (see below) or 'mongodb://localhost/<DATABASE_NAME>'

If not specified, KeystoneJS will first look for one of the following environmental variables:

  • CONNECT_TO,
  • DATABASE_URL,
  • MONGO_URI,
  • MONGODB_URI,
  • MONGO_URL,
  • MONGODB_URL,
  • MONGOLAB_URI,
  • MONGOLAB_URL

If none of these are found a connection string is derived with a DATABASE_NAME from the KeystoneJS project name.

mongooseOptions (optional)

These options are passed directly through to mongoose.connect().

See: https://mongoosejs.com/docs/api.html#mongoose_Mongoose-connect for a detailed list of options.

Dependents (4)

Package Sidebar

Install

npm i @keystone-alpha/adapter-mongoose

Weekly Downloads

39

Version

6.0.1

License

MIT

Unpacked Size

29.4 kB

Total Files

5

Last publish

Collaborators

  • emmatown
  • jedwatson
  • molomby