Skip to content
KeystoneJS LogoKeystoneJS (α)

Mongoose Database Adapter

Usage

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

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

const mongooseOptions = {
  /* .. */
};
const mongoDbUri = '';

keystone.connect(mongoDbUri, mongooseOptions);

API

mongoDbUri

Default: 'mongodb://localhost:27017/${SAFE_KEYSTONE_NAME}'

This URI will be passed directly to Mongoose (and hence MongoDB) as the location of the database.

mongooseOptions

mongooseOptions.*

All other options are passed directly to Mongoose.

See the Mongoose docs for more.

Have you found a mistake, something that is missing, or could be improved on this page? Please edit the Markdown file on GitHub and submit a PR with your changes.

Edit Page