- Timestamp:
- 2020-02-03T23:20:33+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/mongodb-data/tables.txt
r33889 r33894 216 216 ]); 217 217 218 219 5b. Table 5b: 220 Table of count of sites with numPagesCoMRI > 0 221 222 Combine the following two: 223 224 - OVERSEAS 225 226 db.Websites.aggregate([ 227 { 228 $match: { 229 $and: [ 230 {geoLocationCountryCode: {$ne: "NZ"}}, 231 {domain: {$not: /\.nz/}}, 232 {numPagesContainingMRI: {$gt: 0}} 233 ] 234 } 235 }, 236 { $unwind: "$geoLocationCountryCode" }, 237 { 238 $group: { 239 _id: {$toLower: '$geoLocationCountryCode'}, 240 count: { $sum: 1 }, 241 /*domain: { $addToSet: '$domain' },*/ 242 numPagesInMRICount: { $sum: '$numPagesInMRI' }, 243 numPagesContainingMRICount: { $sum: '$numPagesContainingMRI' }, 244 totalPagesAcrossMatchingSites: { $sum: '$totalPages'} 245 } 246 }, 247 { $sort : { count : -1} } 248 ]); 249 250 - NZ: 251 252 db.Websites.aggregate([ 253 { 254 $match: { 255 $and: [ 256 {numPagesContainingMRI: {$gt: 0}}, 257 {$or: [{geoLocationCountryCode:"NZ"},{domain: /\.nz/}]} 258 ] 259 } 260 }, 261 { $unwind: "$geoLocationCountryCode" }, 262 { 263 $group: { 264 _id: "nz", 265 count: { $sum: 1 }, 266 /*domain: { $addToSet: '$domain' },*/ 267 numPagesInMRICount: { $sum: '$numPagesInMRI' }, 268 numPagesContainingMRICount: { $sum: '$numPagesContainingMRI' }, 269 totalPagesAcrossMatchingSites: { $sum: '$totalPages'} 270 } 271 }, 272 { $sort : { count : -1} } 273 ]); 274
Note:
See TracChangeset
for help on using the changeset viewer.