indexing #984

Closed
aheckmann opened this Issue Jun 26, 2012 · 3 comments

Projects

None yet

2 participants

@aheckmann

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

@evdb

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 });
@aheckmann

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

btw, object key order in javascript is not guaranteed.

@evdb

Have done - it is now issue #1004

@aheckmann aheckmann added a commit that referenced this issue Jul 14, 2012
@aheckmann aheckmann indexes can be manually created 43b28a5
@aheckmann aheckmann closed this in 0cfb1ab Jul 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment