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 8022561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:17:50+00:00 2026-06-04T22:17:50+00:00

I had an existing Django nonrel application using MongoDB. Seemed that the related fields

  • 0

I had an existing Django nonrel application using MongoDB.
Seemed that the related fields of objects are stored by ObjectIDs. For example, I have an UserProfile model which relates to User objects by OneToOneField. And the stored objects data was like:

{
    "_id": {
        "$oid": "4f67540040e0460001000001"
    },
    "user_id": {
        "$oid": "4f67540040e0460001000000"
    },
    ....
}

I deployed the application on Heroku which uses git repository to fetch django nonrel projects and django-mongodb-engine. The pymongo version I used is 2.1.1. I am not sure because of the update of which library, I found that the related fields seems not stored by ObjectId anymore. New objects data is stored like:

{
    "_id": {
        "$oid": "4f67540040e0460001000001"
    },
    "user_id": "4f67540040e0460001000000",
    ....
}

The problem is it causes errors due to data format inconsistency. Not only I couldn’t get related object of previously stored objects (getting “DoesNotExist: UserProfile matching query does not exist.”). Related objects of newly saved objects couldn’t be fetched by Piston as well.

I tried to add revision specifier to git repository URLs in requirements.txt but had no luck, which is weird.

Does anyone know about what was going on? Perhaps I have to do a mongoDB data update to fix those related data id values?

  • 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-04T22:17:53+00:00Added an answer on June 4, 2026 at 10:17 pm

    What version were you using previously? – Need to know django-nonrel / djangotoolbox versions as well.

    Seems like you might have to manually migrate the data – but it would be good to nail down the revision where the change happened to ensure its not a transient change.

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

Sidebar

Related Questions

I had some existing VBA code that was building queries using string concatenation. I
I'm using an existing library that wasn't compiled with ARC and had the following
I had an existing Django project that I've just added South to. I ran
I'm trying to start modifying an existing application with Eclipse. Actually I had it
I created the models in a Django app using manage.py inspectdb on an existing
I've recently started using Gradle and replacing my existing Maven-based projects. I have had
I have an existing application that controls a machine and want to add a
I'm using Capistrano to deploy a Django application (it uses Nginx as the web
I'm using django-non rel for the first time. I already had a simple django
I have a django project with an existing db that I would really like

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.