我先寫一下出處 |
---|
省得被告侵犯著作權 |
不過 |
我想它應該也懶得花大錢 就為了這點小事來台灣告我 |
美國找律師粉貴阿 |
告我又拿不到什麼錢 |
這是mongodb的lab問題 |
出處: |
https://university.mongodb.com/mercury/M001/2021_March_16/chapter/Chapter_4_Advanced_CRUD_Operations/lesson/5f36f52104e9ffa9293e896es/problem |
沒辦法,上禮拜聽過板橋智財法院的法官的演講 |
我寫的Query : |
db.companies.find({"$and" : [{"founded_year":2005}, {"$or" :[ {category_code:"web"}, {"founded_month":10}, {category_code:"web"} ] }, {"$or" :[ {category_code:"web"}, {category_code:"web"} ] } ] }.count() |
---|
這是mongodb 給出來的答案 |
---|
db.companies.find({ "$and": [{ "$or": [ { "founded_year": 2004 }, { "founded_month": 10 } ] }, { "$or": [ { "category_code": "web" }, { "category_code": "social" } ] } ] }).count() |
看了答案後,我傻眼了 |