Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Allow to pass additional options for run('createIndex') #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ovr
Copy link
Contributor

@ovr ovr commented Jun 29, 2018

Hey!

It allow us to do (pass advanced options for createIndex)

await db._run('createIndex', 'user', {
        columns: 'login',
        options: {
            name: 'login_uniq',
            unique: true,
            partialFilterExpression: {
                status: {
                    $eq: [
                        'ACTIVE',
                        'BLOCKED'
                    ]
                }
            }
        }
});

Thanks

@ovr ovr force-pushed the allow-to-create-partial-index-by-calling-private-run branch from f0081bc to ae2c522 Compare June 29, 2018 08:28
Signed-off-by: Dmitry Patsura <talk@dmtry.me>
@ovr ovr force-pushed the allow-to-create-partial-index-by-calling-private-run branch from ae2c522 to a961356 Compare June 29, 2018 08:40
Signed-off-by: Dmitry Patsura <talk@dmtry.me>
@ovr ovr force-pushed the allow-to-create-partial-index-by-calling-private-run branch from 6d92164 to 1b0068d Compare July 3, 2018 07:48
Copy link

@gjbaxter gjbaxter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice if we could have enabled the options to be passed to addIndex: function(collectionName, indexName, columns, unique, callback) along side 'unique'.. or.. perhaps an options object replacing unique. But I guess that maybe an interface change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants