- Timestamp:
- 2019-11-13T23:08:37+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/MoreReading/mongodb.txt
r33653 r33666 346 346 https://docs.mongodb.com/manual/reference/method/db.collection.find/ 347 347 https://docs.mongodb.com/manual/reference/method/db.collection.find/#find-projection 348 349 350 ------------------- 351 352 Some queries with results: 353 354 # Num websites 355 db.getCollection('Websites').find({}).count() 356 1446 357 358 # Num webpages 359 db.getCollection('Webpages').find({}).count() 360 75139 361 362 # Find number of websites who have 1 or more pages in Maori (a positive numPagesInMRI) 363 db.getCollection('Websites').find({numPagesInMRI: { $gt: 0}}).count() 364 361 365 366 # Find number of webpages that are deemed to be overall in MRI (pages where isMRI=true) 367 db.getCollection('Webpages').find({isMRI:true}).count() 368 X5224 369 5215 370 371 # Number of pages that contain any number of MRI sentences 372 db.getCollection('Webpages').find({containsMRI: true}).count() 373 12858 374 375 # Number of sites with URLs containing /mi(/) 376 db.getCollection('Websites').find({urlContainsLangCodeInpath:true}).count() 377 153 378 379 # Number of websites that are outside NZ that contain /mi(/) in any of its sub-urls 380 db.getCollection('Websites').find({urlContainsLangCodeInpath:true, geoLocationCountryCode: {$ne : "NZ"} }).count() 381 148 382 383 # 5 sites with URLs containing /mi(/) that are in NZ 384 db.getCollection('Websites').find({urlContainsLangCodeInpath:true, geoLocationCountryCode: "NZ"}).count() 385 5 386 387 # sort websites that contain /mi(/) in path by geoLocationCountryCode 388 # https://www.quackit.com/mongodb/tutorial/mongodb_sort_query_results.cfm 389 db.getCollection('Websites').find({urlContainsLangCodeInpath:true}).sort({geoLocationCountryCode: 1}) 390 391
Note:
See TracChangeset
for help on using the changeset viewer.