Skip to content

how to insert data to list? #525

Answered by msiemens
astrofox09 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @astrofox09, I assume you ask this in context of the db.update() method? If yes, it'd go like this:

db.insert({'foo': [{'name': 'bar'}]})
db.update(lambda doc: doc['foo'].append({'name': 'baz'}))

Does this help you?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by astrofox09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants