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
If we save a object without populating the nested objects we lose the nested keywords. The modified example below shows the issue.
var mongoose = require('mongoose'); var mongooseKeywords = require('mongoose-keywords'); var GenreSchema = new mongoose.Schema({ title: String }); GenreSchema.plugin(mongooseKeywords, {paths: ['title']}); var ArtistSchema = new mongoose.Schema({ name: String, genre: { type: mongoose.Schema.ObjectId, ref: 'Genre' } }); ArtistSchema.plugin(mongooseKeywords, {paths: ['name', 'genre']}); var Genre = mongoose.model('Genre', GenreSchema); var genre = new Genre({title: 'Jrock'}); console.info(genre.keywords); // ['jrock'] var Artist = mongoose.model('Artist', ArtistSchema); var artist = new Artist({name: "L'arc~en~Ciel", genre: genre._id}); /* genre saved as object id */ console.info(artist.keywords); // ['larc en ciel', 'jrock']
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If we save a object without populating the nested objects we lose the nested keywords. The modified example below shows the issue.
The text was updated successfully, but these errors were encountered: