Arbitrary document keys
englercj opened this issue · comments
Chad Engler commented
Right now a schema is assumed to use _id as the main key. This should be configurable, any field should be able to be the key for a schema, including a custom prefix:
var siteSchema = new kouch.Schema({
ip: { type: String, key: true, prefix: 'site:'},
name: String,
url: String
});
If no field is marked as key
then _id should be added and used. If a field is marked as the key is should only be automatically generated if the auto: true
property is set.
Chad Engler commented
In progress on feature-custom-keys
Chad Engler commented
Merged!