OptionalchoicesOptionalcollectionUsed for properties that are references to other documents. The value of this should be the name of the collection that the referenced document lives in.
eg. collection: "Users", would be useful for refering to documents that live in a "Users" collection of a database.
No, you cannot refer to collections that exist in separate database clients.
OptionaldefaultThe default data of this property, to be used if no data is provided or if a soft-invalidation occurs.
OptionalinvalidateDetermines whether not an invalid value for min, max, minLength, and maxLength properties will throw an error or just roll-over and allow the value to exist. Depending on the property, it may get replaced with a default or min or max value if this is set to false.
OptionalmatchThe regex expression that will be run against this property's data value. If the regex doesn't match, validation fails.
OptionalmaxThe highest value that this property can have for its data value. For properties that are numbers.
OptionalmaxThe highest length that this property can have for its data value. For properties that are strings or arrays.
OptionalminThe lowest value that this property can have for its data value. For properties that are numbers.
OptionalminThe shortest length that this property can have for its data value. For properties that are strings or arrays.
OptionalpadIf an array data value's length is too short, this is the value that will be used to pad the array until it meets the minLength property.
OptionalpadIf a string data value is too short, this is the value that will be used to pad the data until it meets the minLength property.
OptionalrequiredWhether or not a property defined in the document's rules object must have a value in its data.
A JavaScript class or type. This should be on every document key rule object, it is required. Various other constraints depend on the type!
OptionaluniqueWhether or not the data value for this property should be unique within the database. This sets up a NeDB index, so it's not immediately checked at a SuperCamo level - but NeDB immediately enforces it.
OptionalvalidateA custom validate function that runs alongside any other constraints. The function must receive one parameter, which the document will pass in automatically - the parameter is the document's data for this property.
An array of data that should match the specified type, to restrict the possible values of this property.