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

  • SEARCH
  • Home
  • 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 8605185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:45:49+00:00 2026-06-12T02:45:49+00:00

I have a document called login_info which contains the following fields: class login_info(Document): user_name

  • 0

I have a document called login_info which contains the following fields:

class login_info(Document):
    user_name = StringField(max_length=120)
    password = StringField(max_length=120)
    email = EmailField()
    gender = StringField(max_length=120)
    date_of_birth = DateTimeField()
    visibility  = StringField(max_length=120)
    client_id = ObjectIdField(required=False)
    location = ListField(EmbeddedDocumentField("Tracking"))`

In the above fields location is an embedded document which contains the following fields:

  • time

  • latitude,

  • longitude

I want to delete a value from this embedded document which satisfy the following condition.

time < system_datetime.

following is an example data in the login_info document:

{
    "_cls":"login_info",
    "_id":ObjectId("5046f43c12d0592e3f59e25d"),
    "_types":[
        "login_info"
    ],
    "date_of_birth":ISODate("2011-02-07T00:00:00 Z"),
    "email":"jack@gmail.com",
    "expire":1346827684,
    "gender":"male",
    "issue":1346827324,
    "key":"47d1e64e51dfa1cf99ce4a59e0c940",
    "location":[
        {
            "Latitude":"5615.3111",
            "_types":[
                "Tracking"
            ],
            "_cls":"Tracking",
            "Longitude":"1236.711",
            "time":ISODate("2012-09-13T12:24:36.051 Z")
        },
        {
            "Latitude":"000",
            "_types":[
                "Tracking"
            ],
            "_cls":"Tracking",
            "Longitude":"3.70",
            "time":ISODate("2012-09-25T18:30:57.756 Z")
        },
        {
            "Latitude":"11",
            "_types":[
                "Tracking"
            ],
            "_cls":"Tracking",
            "Longitude":"1",
            "time":ISODate("2012-09-26T10:25:29.157 Z")
        },
        {
            "Latitude":"11",
            "_types":[
                "Tracking"
            ],
            "_cls":"Tracking",
            "Longitude":"1",
            "time":ISODate("2012-09-26T10:40:58.895 Z")
        },
        {
            "Latitude":"11",
            "_types":[
                "Tracking"
            ],
            "_cls":"Tracking",
            "Longitude":"1",
            "time":ISODate("2012-09-26T10:54:08.361 Z")
        },
        {
            "Latitude":"11",
            "_types":[
                "Tracking"
            ],
            "_cls":"Tracking",
            "Longitude":"1",
            "time":ISODate("2012-09-26T11:08:55.873 Z")
        }
    ],
    "password":"jack",
    "refresh_token":"22580a8f69",
    "token":"bac8a5f863",
    "user_name":"jack",
    "visibility":"visible"
}
  • 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-06-12T02:45:51+00:00Added an answer on June 12, 2026 at 2:45 am

    If you want to remove a single location embedded document from a login_info document with MongoEngine, do something like:

    // add 
    loc1 = Tracking( time=datetime(2011, 11, 5, 0, 0, 0) )
    loc2 = Tracking( time=datetime(2012, 10, 5, 0, 0, 0) )
    
    login = login_info( user_name='Mark', location=[loc1, loc2] )
    login.save()
    
    // remove locations from the location list
    login.objects( title=user_name='Mark' ).update_one( pull__lt=datetime.now() )
    

    Note: The mongoengine 0.7.5 has a bug, so you’ll have to download the latest version from https://github.com/MongoEngine/mongoengine

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

Sidebar

Related Questions

I have a document called login_info . It has two fields: name password Location
I have a document called login . the document contains the following: username password
I have an object called Document that has a one-to-many relationship with DocumentPersonCc. I
As per API document, credentials_blob_updated callback is called when storable credentials have been updated.
I have a cookie called login that contains a structure like username|hashcode|salt . Here's
I have a UIViewController which contains a UIWebView . i login to a website
(r'^media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}), As you can see, I have a directory called media under
I have a document type of info I also have some custom properites. infoTitle
i have a document like this: English English English English 中文中文中文中文中文 English English English
I have a document file containing HTML markup. I want to assign the contents

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.