Thanks in advance. I have a mongoose schema as below:
var bookSchema = new mongoose.Schema({
name: { type: String, index: true, default: '' },
text: { type: String, index: true, default: '' },
date: { type: Date, default: Date.now },
price: { type: Number, default: 0 } });
bookSchema.index({text: 1, name: 1}, {unique: true});
My problem is when I search for any text in the field named "text" it doesn't work. Possibly a naming conflict, do I have to change the field name to something other than text...
Book.find( { $text : { $search : 'mongoose is great' } } )...