Changeset 33800 for other-projects/maori-lang-detection/MoreReading
- Timestamp:
- 2019-12-12T18:04:10+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/MoreReading/mongodb.txt
r33787 r33800 479 479 480 480 # Number of sites with URLs containing /mi(/) 481 db.getCollection('Websites').find({urlContainsLangCodeIn path:true}).count()481 db.getCollection('Websites').find({urlContainsLangCodeInPath:true}).count() 482 482 153 483 483 484 484 # Number of websites that are outside NZ that contain /mi(/) in any of its sub-urls 485 0db.getCollection('Websites').find({urlContainsLangCodeInpath:true, geoLocationCountryCode: {$ne : "NZ"} }).count()485 db.getCollection('Websites').find({urlContainsLangCodeInPath:true, geoLocationCountryCode: {$ne : "NZ"} }).count() 486 486 148 487 487 488 488 # 5 sites with URLs containing /mi(/) that are in NZ 489 db.getCollection('Websites').find({urlContainsLangCodeIn path:true, geoLocationCountryCode: "NZ"}).count()489 db.getCollection('Websites').find({urlContainsLangCodeInPath:true, geoLocationCountryCode: "NZ"}).count() 490 490 5 491 491 492 492 # sort websites that contain /mi(/) in path by geoLocationCountryCode 493 493 # https://www.quackit.com/mongodb/tutorial/mongodb_sort_query_results.cfm 494 db.getCollection('Websites').find({urlContainsLangCodeIn path:true}).sort({geoLocationCountryCode: 1})494 db.getCollection('Websites').find({urlContainsLangCodeInPath:true}).sort({geoLocationCountryCode: 1}) 495 495 496 496 Actually, I want to sort by count. See https://docs.mongodb.com/manual/reference/operator/aggregation/sortByCount/ … … 498 498 499 499 # PROJECTION: 500 db.getCollection('Websites').find({geoLocationCountryCode: {$ne:"nz"}}, {geoLocationCountryCode:1, urlContainsLangCodeIn path: 1})500 db.getCollection('Websites').find({geoLocationCountryCode: {$ne:"nz"}}, {geoLocationCountryCode:1, urlContainsLangCodeInPath: 1}) 501 501 502 502 https://docs.mongodb.com/manual/aggregation/
Note:
See TracChangeset
for help on using the changeset viewer.