We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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.
The text was updated successfully, but these errors were encountered:
That's a good suggestion, currently mongoose does not support that but I'd love to add it for a future release
Sorry, something went wrong.
feat(query): add PoC for runSetters option
7d78a75
Re: #4569
feat(query): add more fleshed out runSettersOnQuery re: #4569
173d72e
4.10.0 has an option called runSettersOnQuery, for example:
runSettersOnQuery
var testSchema = new Schema({ name: { type: String, lowercase: true }, num: { type: Number, set: function(v) { return Math.floor(v); } } }, { runSettersOnQuery: true });
That will run setters when you're querying
No branches or pull requests
When a property is specified to be lower cased in the schema -
Shouldn't the select statements that filter on this property lower-case the input?
VS. doing this before hand?
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.
The text was updated successfully, but these errors were encountered: