Hi
I am upserting a document like this
let conversation = {
contextGraphId: graph.graphId,
authorGraphId: posting.authorGraphId,
authorName: posting.authorName,
authorScreenName: posting.authorScreenName,
authorThumbnail: posting.authorThumbnail,
service: posting.service
};
let selector = { service: posting.service, authorGraphId: posting.authorGraphId };
let conversationId = Conversations.upsert(selector, { $set: conversation }); <------------- Offending line
posting.conversationId = conversationId
Postings.insert(posting);
Problem is that the Conversations.upsert
only returns an ID upon insertion. I also want to retrieve the ID in the case that the document was updated.
Is there any way to accomplish this without resorting to a seperate find query?
Thanks