Closed thedanielfactor closed 6 years ago
try this
task.save(GroupSession, groupSession)
.update("UserPresence", {_id: userId}, {
session_id: {$ojFuture: "0._id"}
, session_presence_id: {$ojFuture: "0.user_list.0._id"}
});
The template for accessing an item in a list is "list.index.propertyOfObjectAtIndex"
Ah, I see what you did there :). Thanks for the fast reply!
The Daniel Factor 913.523.6104
On Nov 28, 2017, at 9:59 AM, Emmanuel Olaojo notifications@github.com wrote:
try this
task.save(GroupSession, groupSession) .update("UserPresence", {_id: userId}, { session_id: {$ojFuture: "0._id"} , session_presence_id: {$ojFuture: "0.user_list.0._id"} }); The template for accessing an item in a list is "list.index.propertyOfObjectAtIndex"
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/e-oj/Fawn/issues/36#issuecomment-347570229, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbXcnTLZ1fFKvUMIKimN_IPpFCkYxNRks5s7C3zgaJpZM4Qtdn6.
No problem 👍
So is I have a schema with a subdocument. I want to create a document with a subdocument and then reference the subdocument with the
$ojFuture
. So I would like to access the subdocument like:This does not appear to work. Any ideas on how I could accomplish this?
Here is a more complete example:
I do the following :