Skip to content
This repository

indexing #984

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

2 participants

Aaron Heckmann Edmund von der Burg
Aaron Heckmann
Collaborator

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

Edmund von der Burg
evdb commented July 09, 2012

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 });
Aaron Heckmann
Collaborator

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

btw, object key order in javascript is not guaranteed.

Edmund von der Burg
evdb commented July 11, 2012

Have done - it is now issue #1004

Aaron Heckmann aheckmann closed this in 0cfb1ab July 13, 2012
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.