You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to access the "id" field through a field called "candidate_id" (since I can't name it id, as that field name is reserved for pk's), like this:
class DedupedCandidate(models.Model):
class Meta:
db_table = 'deduped_candidates'
Hi
I am new to mongodb-engine and am enjoying it. Ran into an issue, and apologies if this is not the right forum or if it's already been answered.
I have documents in one of my tables that have both an _id field, for the ObjectId, and an id field, which is not a pk, like this:
"_id": {
"$oid": "5505e78068bd7bdc667c1926"
},
"id": 1114157,
"duplicates": [],
"application_ids": [
1125668
],
I am trying to access the "id" field through a field called "candidate_id" (since I can't name it id, as that field name is reserved for pk's), like this:
class DedupedCandidate(models.Model):
class Meta:
db_table = 'deduped_candidates'
But when I look at an object in the admin, candidate_id is populated with _id["$oid"], when it should be populated with the "id" field's value.
So I am assuming somewhere the db_column "id" is being mapped to "_id"; is that correct? And is there a way to prevent that from happening?
The text was updated successfully, but these errors were encountered: