Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.rares_news_collection.aggregate([
- {
- $project: {
- _id: 0,
- fingerprintSize: {
- $cond: [
- { $isArray: "$fingerprints" },
- { $size: "$fingerprints" },
- 0
- ]
- }
- }
- },
- {
- $group: {
- _id: null,
- avgFingerprintSize: { $avg: "$fingerprintSize" }
- }
- },
- {
- $project: {
- _id: 0,
- avgFingerprintSize: 1
- }
- }
- ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement