Frank T
unread,Jul 2, 2011, 11:32:48 AM7/2/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
I have seen quite a few posts on this subject, but all the answers
seem to suggest that the new projection feature will allow this one to
do this. What I am looking for is the ability to have fields that are
stored in the database that are calculated based on other fields in
the same document. For example, say I have this document structure:
{
"sensor" : "test",
"hits" : 100,
"serverTime" : 10000,
"average" : function() { return serverTime / hits; }
}
In this example, average would be recalculated when the document is
updated via $inc etc... Is this possible with MongoDB today?