Skip to content

'id' based query other than of type ObjectId is returning None #370

@PraveenKumarPalai

Description

@PraveenKumarPalai

This is the issue that I am facing:

ResultsModel.find_one({ 'order.customer.id': customer_id, 'order_source': order_source, })

returns None

Whereas,

ResultsModel.find_one({ 'order.customer.customer_id': customer_id, 'order_source': order_source, })
(using customer_id instead of id (same value)) works - returns Data

Or

ResultsModel.find_one({ 'order.customer.email': customer_email, 'order_source': order_source, })

returns Data

Here, order.customer.id is of type int
and order is of type fields.DictField()

Note: Creating Embedded Docs. work, but in my case orders is a complex nested structure and it may have varying structures so cannot fix the schema. Hence using fields.DictField() instead of fields.EmbeddedField()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions