// Sekcja 6.4.5. Operatory zbioru.

testSet1 = ['ogród']
db.products.aggregate([
    {$project:
    {productName: '$name',
        tags:1,
        setEquals: {$setEquals:['$tags',testSet1]},
        setIntersection: {$setIntersection:['$tags',testSet1]},
        setDifference: {$setDifference:['$tags',testSet1]},
        setUnion: {$setUnion:['$tags',testSet1]},
        setIsSubset: {$setIsSubset:['$tags',testSet1]},
        setIntersection: {$setIntersection:['$tags',testSet1]}
    }
    }
])

//    /*  Oczekiwane wyniki.
//     > db.setOperatorsTest.find().pretty()
//
//     {
//     "_id" : ObjectId("4c4b1476238d3b4dd5003981"),
//     "productName" : "Bardzo duża taczka",
//     "tags" : ["narzędzia", "ogród", "ziemia"],
//     "setEquals" : false,
//     "setIntersection" : ["ogród"],
//     "setDifference" : ["narzędzia","ziemia"],
//     "setUnion" : ["ogród","narzędzia","ziemia"],
//     "setIsSubset" : false
//     }
//
//     {
//     "_id" : ObjectId("4c4b1476238d3b4dd5003982"),
//     "productName" : "Gumowe rękawice robocze, kolor czarny",
//     "tags" : ["ogród"],
//     "setEquals" : true,
//     "setIntersection" : ["ogród"],
//     "setDifference" : [ ],
//     "setUnion" : ["ogród"],
//     "setIsSubset" : true
//     }
//
//     */