first commit

This commit is contained in:
spiduler
2021-07-13 17:11:27 +09:00
commit d36fd3864c
17 changed files with 5217 additions and 0 deletions

17
mongoQuery.msh Normal file
View File

@@ -0,0 +1,17 @@
// Kw6pSBMvxgcHTh3X
// count duplicates
db.Catalog.aggregate({ $group: { _id: { ean: '$ean', site: '$site' }, count: { $sum: 1 } } }, { $match: { count: { $gt: 1 } } }, { $count: 'ean' })
// count ean for site
db.Catalog.aggregate({ $group: { _id: { ean: '$ean', site: '$site' } } }, { $count: 'ean' })
// image empty
db.Catalog.aggregate({ $match: { site_main_img: null } }, { $count: 'ean' })
// rename field
db.Catalog.updateMany({}, { $rename: { Ean: 'ean', Site: 'site', Uri: 'url' } })
// GD4eYvJMHUkXmajs
db.Catalog.find({main_img: {$ne: null}}).limit(1)