Skip to content


Subversion checkout URL

You can clone with
Download ZIP


indexing #984

aheckmann opened this Issue · 3 comments

2 participants


pass index errors along to index event.
allow disabling auto-creation
allow manually triggering creation


Possibly related to this work - so not creating a new ticket:

If you specify both unique: true and index: true in a schema field definition the unique is silently ignored. This test code demonstrates it:

    # insert at line 913 of test/schema.test.js
    var T25 = new Schema({
        name: { type: String, unique: true, index: true }
    assert.deepEqual(T25.path('name')._index, { unique: true });

I'd expect that either a unique index be created, or a warning be produced. Especially annoying is that reversing the order in the definition make the index be created as expected (behaviour may well vary across machines...):

    # For me this test passes
    var T25 = new Schema({
        name: { type: String, index: true, unique: true,  }
    assert.deepEqual(T25.path('name')._index, { unique: true });

:( good catch. please open a separate issue for this.

btw, object key order in javascript is not guaranteed.


Have done - it is now issue #1004

@aheckmann aheckmann closed this in 0cfb1ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.