Hi,
This is my first post and I’m relatively new to Mongo.
I have three collections - Sources, Tags, and Excerpts.
A source is anything like a book, url, paper, etc.
An excerpt is a extract or quotation taken from a source.
A tag is simply a way of categorising Excerpts by area of interest.
When I create a new source I want to reference the Source it came from, and add Tags from the Tags collection. This is what I have so far:
db.rfmExcerpts.insertMany([
{
isSample: false,
tags: [],
owner: "d",
title: "Rating agencies slow to react",
pages: 26,
body: "The ratings agencies should have been the first one to detect problems in the housing market. ",
use: "In his book 'The Undercover Economist', (Harford, J. 2007) Joe Harford points out that etc, etc.",
notes: "Need to find other parallels",
source: {}
}
]}
How do I populate the ‘tags’ field with the IDs of some specific tags I want to attach to this excerpt. for example ‘economics’ and ‘banking’ which already exist in the Tags collection, and similarly, how do I fetch the ID of the source ‘The Undercover Economist’ which I know exists in the Source table.
Any help greatly appreciated, thank you.