2

I have an id which some tags are associated with and I want to fill a collection with those tags. How do I do this?

Suppose I have the following:

key: 12345, tags = ["foo","bar","foobar"]

So I am hoping to get a document in a collection named "Tags" like this:

{ 
  "_id" : ObjectId("4fbaa6076a56b2700d000000"), 
  "key" : 12345, 
  "tags" : ["foo","bar","foobar"] 
}

How do I do this in python?

1 Answer 1

4
mongo_conn.Tags.insert({
    "key": 12345,
    "tags": ["foo","bar","foobar"]
})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.