“MongoDB $ in Regex” Code-Antworten

MongoDB $ in Regex

// Find user who has the first_name equal with "name" (case insensitive)
const users = await User.find({
	first_name: {
    	$in: [new RegExp(`^${name}$`, 'i'))]
    }
})
florinrelea

Mongodb Regex

{ <field>: { $regex: /pattern/, $options: '<options>' } }
{ <field>: { $regex: 'pattern', $options: '<options>' } }
{ <field>: { $regex: /pattern/<options> } }
Adorable Angelfish

Ähnliche Antworten wie “MongoDB $ in Regex”

Fragen ähnlich wie “MongoDB $ in Regex”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen