Skip to content

Non-issue regarding lowercase attribute in schema declaration and queries  #4569

Closed
@daretodave

Description

@daretodave

When a property is specified to be lower cased in the schema -

...   = new Schema({
  username: {type: String, lowercase: true}
})

Shouldn't the select statements that filter on this property lower-case the input?

                User.findOne({
                    username: "DAVID"
                },

VS. doing this before hand?

                User.findOne({
                    username: username.toLowerCase()
                }

The former find seems more practical when the schema denotes the property is lower-cased.

Additionally insert has this behavior of automatically lower-casing the property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions