Meine Sammlung:Wie basierend auf einzigartige Embedded Array Zählwerte
{ "_id" : 1, "type" : "A", "types" : [ "type1://asfasd", "type2://xcvxcv" ] }
{ "_id" : 2, "type" : "B", "types" : [ "type1://xcv" ] }
{ "_id" : 3, "type" : "C", "types" : [ "type2://aewqqwe" ] }
{ "_id" : 4, "type" : "D", "types" : [ "type2://xcxc" ] }
ich das Endergebnis will und mir sagen, zählen: Sie einen regulären Ausdruck
type1 -> 2 (because there are total of 2 documents that has type1)
type2 -> 3 (because there are total of 3 documents that has type2)
ist alle Ihre Dokumente 'types' Präfixe Werte ('type1',' type2') haben eine konstante Länge (hier 5)? Oder gibt es Präfixe unterschiedlicher Länge (wie 'http' und' https')? – tarashypka
Nein gibt es nicht in einer festen Größe (kann type1: //, othertype3: // sein). Ich nehme mindestens 3 Buchstaben vor dem: // ist OK (wenn Teilstr. Hier geplant ist?) – shayy