Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6127021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:27:09+00:00 2026-05-23T16:27:09+00:00

My application is a simple TODO list, this are my classes with MongoEngine… class

  • 0

My application is a simple TODO list, this are my classes with MongoEngine…

class Task(EmbeddedDocument):
    content = StringField()
    slug = StringField()
    position = IntField()
    priority = IntField()
    status = IntField()

class List(EmbeddedDocument):
    name = StringField()
    slug = StringField()
    tasks = ListField(EmbeddedDocumentField(Task))

class User(Document):
    email = StringField()
    twitter = StringField()
    lists = ListField(EmbeddedDocumentField(List))

I push to the User lists with…

list = List()
list.name = request.form['name']
list.slug = slugify(request.form['name'])
User.objects(twitter=session['username']).update_one(push__lists=list)

The logic is that the user have multiple lists and each lists can have multiple tasks.

Now I want to push a task in certain list, but I can’t find the way with MongoEngine. The approach could be some like this:

User.objects(twitter=session['username']).update_one(push__lists__listname__task=list)

Which is the correct way of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:27:09+00:00Added an answer on May 23, 2026 at 4:27 pm

    This isn’t currently possible, either with MongoDB or MongoEngine.

    The development branch of MongoEngine has some support for the $ positional operator, but MongoDB only supports using the positional operator once per update — that is you cannot use it to update lists nested within lists (even if indirectly, as in your example).

    If you need to perform atomic updates on the todo lists, you should reconsider your data model to allow this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a simple Todo List application where I want to be able to
I would like to build some simple application - for example Todo list -
I'm planning to create a simple gadget to create a TO DO list application.
I have a list of Gesture classes in my application: List<Gesture> gestures = new
Suppose I have a simple to-do list application. The application contains two models: lists
Am following the tutorial here on creating a simple todo list app: http://www.mydroid.apnafundaz.com/2010/07/todolist-application-in-android-step-by-step-guide-with-screen-shots/ Have
I'm trying to call contacts through the default contacts application in a simple list
I have a fairly simple web application that gets a list of items from
I whipped up this little sample application to demonstrate how to maintain a list
Was creating a simple console application to do some prototyping and was shocked to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.