$addFields cost in aggregation framework

80 views
Skip to first unread message

Fernando Aspiazu

unread,
May 23, 2017, 10:47:26 AM5/23/17
to mongodb-user
Good morning all!

I would ask, what is the impact on performances when using $addFields operator in aggregation framework? What's the cost? Specially if I have million of documents?

Thanks in advance.

Asya Kamsky

unread,
May 23, 2017, 11:27:31 AM5/23/17
to mongodb-user
Of course it may depend on how much work you're doing in the expressions of $addFields and how many fields you're adding, but it should be pretty negligible normally as the documents are "streaming" through the pipeline and this stage just adds a field or several fields to each document in streaming fashion.

Do you have a specific concern or example?   I imagine it depends on the overall pipeline, whether it would be completely negligible/unmeasurable or noticeable difference.

Asya


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/b85be3bc-a569-4a2e-8911-1b484db81f2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Asya Kamsky
Lead Product Manager
MongoDB
Download MongoDB - mongodb.org/downloads
We're Hiring! - https://www.mongodb.com/careers
Reply all
Reply to author
Forward
0 new messages