low-json-db

Collection Options

When creating a collection you can pass a configuration object to customize its behavior.

const users = db.collection({
  name: 'users',
  autoId: true,
  idField: '_id',
  idType: 'auto',
  indexes: ['email', 'city'],
  pretty: true,
  lazy: false
});
OptionDefaultDescription
nameRequired. Name of the collection.
autoIdfalseAutomatically generate an ID for new documents.
idField'_id'Field name used for the ID (supports nested paths).
idType'auto''auto' | 'uuid' | 'objectid'
indexes[]Array of field names to index.
prettytruePretty-print the JSON files.
lazyfalseReserved for future lazy-loading behavior.
Next: See the full API Reference.