diff --git a/schema/index.txt b/schema/index.txt new file mode 100644 index 0000000..e3fedbd --- /dev/null +++ b/schema/index.txt @@ -0,0 +1,11 @@ +// -*- js -*- + +// connect to db +use content + +// create single index on column sha1 +// unique: key must be unique +// sparse: only return result for which the index exists +// background: build asynchronously +db.content.createIndex({ 'sha1': 1 }, + { 'unique': true, 'sparse': true, 'background': true})