diegohaz / mongoose-keywords Goto Github PK
View Code? Open in Web Editor NEWMongoose plugin that generates a keywords path combining other paths values
License: Other
Mongoose plugin that generates a keywords path combining other paths values
License: Other
Branch | Build failing π¨ |
---|---|
Dependency | eslint |
Current Version | 4.0.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
padded-block
rule (#8783) (Plusb Preco)enforceForArrowConditionals
to no-extra-parens
(fixes #6196) (#8439) (Evilebot Tnawi)overrides
/files
options for glob-based config (fixes #3611) (#8081) (Sylvan Mably)The new version differs by 22 commits.
7d9e3be
4.1.0
e727b7b
Build: changelog update for 4.1.0
e8f1362
Docs: Remove wrong descriptions in padded-block
rule (#8783)
291a783
Update: enforceForArrowConditionals
to no-extra-parens
(fixes #6196) (#8439)
a21dd32
New: Add overrides
/files
options for glob-based config (fixes #3611) (#8081)
879688c
Update: Add ignoreComments option to no-trailing-spaces (#8061)
b58ae2e
Chore: Only instantiate fileEntryCache when cache flage set (perf) (#8763)
9851288
Update: fix indent errors on multiline destructure (fixes #8729) (#8756)
3608f06
Docs: Increase visibility of code of conduct (fixes #8758) (#8764)
673a58b
Update: support multiple fixes in a report (fixes #7348) (#8101)
7a1bc38
Fix: don't pass default parserOptions to custom parsers (fixes #8744) (#8745)
c5b4052
Chore: enable computed-property-spacing on ESLint codebase (#8760)
3419f64
Docs: describe how to use formatters on the formatter demo page (#8754)
a3ff8f2
Chore: combine tests in tests/lib/eslint.js and tests/lib/linter.js (#8746)
b7cc1e6
Fix: Space-infix-ops should ignore type annotations in TypeScript (#8341)
There are 22 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
It would be nice if the transform function can handle arrays as return values so that a transformation can return multiple keywords.
README example doesn't work. require('mongoose-keywords')
Hey,
I just tried mongoose-keywords with querymen (from the yeoman rest template) and upgraded all the packages; keywords seems to break with Mongoose 5.0.x, I'm afraid.
Offending line is:
this[field].addToSet(transform(value))
since this[field] is undefined.
Thanks!
Hi dude,
Awesome job on mongoose-keywords and all the other plugins you made for your rest api generator (querymen and bodymen are just... Waw π )
But right now, in spite of all the awesomeness you've put in this, I'm getting stuck trying to get keywords from an array of objects that's inside my schema, here is some JSON of an object that I'd like to get keywords for:
{
"name": "John",
"pets": [{
"name": "YellowBird",
"kind": "bird"
}, {
"name": "PurpleDog",
"kind": "dog"
}]
}
I would like John's "keywords" field to be generated with ['john', 'bird', 'dog']. I tried many things like creating a petSchema but keywords get created inside pets objects and it seems like I can't access them because they are part of an object in an array.
Any clue would be really helpful since I couldn't find any on the Internet, I've been stuck for hours on this and that's the only blocking element that I met so far
Thanks for reading all of this, I hope my bad english is not making it too hard to understand :c
And of course, thanks for your help whenever you answer this π
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']
Right now everything works great, but, as I understand, I can add a query to the request too.
I have http://IP:PORT/guildmembers?access_token=MyToken&sort=nick&limit=100&page=1&fields=discordId%2C%20nick%2C%20roles
working flawlessly, and showing 100 documents with discordId
, nick
and roles
.
Roles is an array, and I would like to query then to those users who have an specific role...lets say, boss
.
I tried adding different combinations of {"roles": {$all: ["Boss"]}}
, but I never get a document in response when adding the query. I don't really understand how mongoose-keywords works, tbh, and Idk if I should add something to my schema.
Any help'll be very appreciated :)
Hi!
I'm rebuilding my API to one generated with generator-rest (great work BTW), but I'm facing an issue.
I noticed that querying the API only works for documents posted to the endpoint generated by generator-rest. I suppose it calls mongoose-keywords to generate the keywords, so it will only find those.
Is there a way to generate the keywords for the 1800 documents I already have in my database, that were posted prior to using generator-rest?
Thanks in advance!
The mongoose-keywords
supports type: unique
to a column and/or relation?
Is it possible to combine it with nested-models
?
Related: #11
const ArtistSchema = new Schema({
name: {
type: String,
keywords: {
type: [String],
unique: true,
},
},
genre: {
type: Schema.Types.ObjectId,
ref: 'Genre',
},
});
ArtistSchema.plugin(mongooseKeywords, { paths: ['name', 'genre'] });
Branch | Build failing π¨ |
---|---|
Dependency | babel-eslint |
Current Version | 7.2.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As babel-eslint is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 6 commits .
3cda62e
7.2.1
5626de1
Remove left over eslint 2 estraverse code (#452)
b5fb53b
Fix type param and interface declaration scoping (#449)
f1cee0f
Remove lodash dependency (#450)
eb05812
Format non-regression errors for legibility (#451)
7972a05
Update README.md with codeFrame option (#448)
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.