2021年3月9日星期二

what will be the time complexity of finding documents with array that contains a specific value in MongoDB?

let say my schema looks something like this

product = {      title : String,      categories : [String(Ref)],  }  

I can query the products using the following

ProductModel.find({ categories: "Sports" });  

let say I have 10000s of products and each product has around 10 categories. what will be the time complexity to query the products like this? is it a good approach?

https://stackoverflow.com/questions/66557769/what-will-be-the-time-complexity-of-finding-documents-with-array-that-contains-a March 10, 2021 at 11:05AM

没有评论:

发表评论