Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.getCollection('article').aggregate([
- {$match: {$or: [
- {"view.sections.parts.embed.provider_name": {$in: ['Commerce Product', 'Image With Hotspots', 'Commerce Product Group']}},
- {"view.sections.steps.parts.embed.provider_name": {$in: ['Commerce Product', 'Image With Hotspots', 'Commerce Product Group']}}
- ]}},
- {$project: {_id: 1}
- ])
- db.getCollection('article').aggregate([
- {$match: {$or: [
- {"view.sections.parts.embed.provider_name": {$in: ['Commerce Product', 'Image With Hotspots', 'Commerce Product Group']}},
- {"view.sections.steps.parts.embed.provider_name": {$in: ['Commerce Product', 'Image With Hotspots', 'Commerce Product Group']}}
- ]}},
- {$project: {
- "provider_names": {
- $reduce: {
- input: {$concatArrays: [
- {$ifNull: ["$view.sections.parts.embed.provider_name", []]},
- {$ifNull: ["$view.sections.steps.parts.embed.provider_name", []]}
- ]},
- initialValue: [],
- in: { $concatArrays : ["$$value", "$$this"] }
- }
- }
- }}
- ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement