mongoose

MongoDB Regex search with language / translation

我只是一个虾纸丫 提交于 2020-12-15 03:39:50
问题 based on my question before regarding the language text search a have an additional question. MongoDb text search with language support The search for singular and plural works! Now I also want to find the ingredients if you don't search for the full name. To make this possible I use a regex. The problem is now that this regex is searching over all translations. I do not want to search for all languages. I want only search for the requested language. How is that possible? Model { translation:

MongoDB Regex search with language / translation

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-15 03:39:45
问题 based on my question before regarding the language text search a have an additional question. MongoDb text search with language support The search for singular and plural works! Now I also want to find the ingredients if you don't search for the full name. To make this possible I use a regex. The problem is now that this regex is searching over all translations. I do not want to search for all languages. I want only search for the requested language. How is that possible? Model { translation:

MongoDB Regex search with language / translation

僤鯓⒐⒋嵵緔 提交于 2020-12-15 03:38:05
问题 based on my question before regarding the language text search a have an additional question. MongoDb text search with language support The search for singular and plural works! Now I also want to find the ingredients if you don't search for the full name. To make this possible I use a regex. The problem is now that this regex is searching over all translations. I do not want to search for all languages. I want only search for the requested language. How is that possible? Model { translation:

MongoDB query fetch with without unwanted data using NestJS

妖精的绣舞 提交于 2020-12-13 05:50:09
问题 { "_id": { "$oid": "5f244a0c9b20935b3bdc2cd9" }, "user": { "rid": "5f12ba968ca0084ee7f7ea9b", "name": "", "phone": “0123456789” }, "clazz": “Test”, "enrolment_history": [{ "_id": { "$oid": "5f245e2f1906715c9e52d675" }, "start_from": { "$date": "2020-06-30T18:30:00.000Z" }, "expires_in": { "$date": "2020-07-31T18:30:00.000Z" }, "enrollment_date": { "$date": "2020-06-30T18:30:00.000Z" }, "payment_method": "Free", "status": "SUCCESS", "clazz_transaction": "5f3e74f8d26e962003103c11", "month":

MongoDB query fetch with without unwanted data using NestJS

て烟熏妆下的殇ゞ 提交于 2020-12-13 05:49:10
问题 { "_id": { "$oid": "5f244a0c9b20935b3bdc2cd9" }, "user": { "rid": "5f12ba968ca0084ee7f7ea9b", "name": "", "phone": “0123456789” }, "clazz": “Test”, "enrolment_history": [{ "_id": { "$oid": "5f245e2f1906715c9e52d675" }, "start_from": { "$date": "2020-06-30T18:30:00.000Z" }, "expires_in": { "$date": "2020-07-31T18:30:00.000Z" }, "enrollment_date": { "$date": "2020-06-30T18:30:00.000Z" }, "payment_method": "Free", "status": "SUCCESS", "clazz_transaction": "5f3e74f8d26e962003103c11", "month":

Mongoose: Cannot fetch file documents from .chunk collection without the data field

余生长醉 提交于 2020-12-13 04:53:06
问题 I'm trying to delete the chunks from files that have not been fully uploaded to a MongoDB database. When uploading files directly to MongoDB, the Mongoose , Multer & GridFSBucket packages seperate media file data into 2 sub-collections for the media collection: media.chunks & media.files . In order to manually delete the file's chunks which are stored in the media.chunks collection, you need the file's ID , which is stored in both the media.files and the media.chunks collection ( file

Mongoose: Cannot fetch file documents from .chunk collection without the data field

為{幸葍}努か 提交于 2020-12-13 04:52:08
问题 I'm trying to delete the chunks from files that have not been fully uploaded to a MongoDB database. When uploading files directly to MongoDB, the Mongoose , Multer & GridFSBucket packages seperate media file data into 2 sub-collections for the media collection: media.chunks & media.files . In order to manually delete the file's chunks which are stored in the media.chunks collection, you need the file's ID , which is stored in both the media.files and the media.chunks collection ( file

Mongoose: Cannot fetch file documents from .chunk collection without the data field

这一生的挚爱 提交于 2020-12-13 04:52:00
问题 I'm trying to delete the chunks from files that have not been fully uploaded to a MongoDB database. When uploading files directly to MongoDB, the Mongoose , Multer & GridFSBucket packages seperate media file data into 2 sub-collections for the media collection: media.chunks & media.files . In order to manually delete the file's chunks which are stored in the media.chunks collection, you need the file's ID , which is stored in both the media.files and the media.chunks collection ( file

Mongodb populating field on aggregation query

独自空忆成欢 提交于 2020-12-13 03:20:24
问题 I have these three collections (Products, Users & Comments) 1. Product Model var ProductSchema = new Schema({ title: { type: String, text: true, required: true }, description: { type: String, required: true }, category: [{ type: String, required: true }], type: [{ type: String, required: true }], isUsed: { type: Boolean, }, manufacturer: { type: String }, price: { type: Number }, }); 2. User Model var UserSchema = new Schema({ firstName: { type: String, text: true, required: true }, lastName:

Count items from another document in mongodb aggregation

徘徊边缘 提交于 2020-12-12 21:34:25
问题 I have two distinct documents as Accounts [ {_id:1, name:'xyz'}, {_id:2, name:'abc'}, {_id:3, name:'def'}, {_id:4, name:'pqr'}, ] and Responses [ {_id:01, accountId:2, questionId: 0001, res: true}, {_id:02, accountId:2, questionId: 0002, res: true}, {_id:03, accountId:1, questionId: 0003, res: false}, {_id:03, accountId:3, questionId: 0002, res: false}, {_id:03, accountId:2, questionId: 0003, res: false}, ] How can I count number of true and false responses for an individual account while