Categories
Database Development

MongoDB indexing strategy for any subsequence of multiple fields

Let’s say I have huge mongodb collection and each element has fields A, B, C, D, E. I want to filter this collection by different groups of this fields like ABC, BDE, AE and so on. Documentation says that for best performance my indexes should cover all fields in my search query. Does it mean […]

Categories
Development

calculate n number of possibilities with array values

I have three arrays A[]={“a”,”b”},B[]={“c”,”d”},C[]={“e”,”f”}. Output={“ace”},{“acf”},{“ade”},{“adf”},{“bce”},{“bcf”},{“bde”},{“bdf”} By using these three arrays i have to calculate the possibilities. Similarly i want to calculate the possibilities for n number of arrays.