Skip to content

dot notation support or append a new document inside embedded model inside a document #39

Closed
@hackerunet

Description

@hackerunet

sorry but I'm not using google app engine, just using django-nonrel with djangotoolbox and mongoengine, and I just saw the site you sent and it has no information about what I'm looking for, can you give me a hand on this?
I have this collection in mongo:

{
"_id" : ObjectId("517f00dbe138234abbf790bb"),
"campaigns" : [
{
"payout" : 0.7,
"landing_page" : [ ],
"rotate_urls" : null,
"_module" : "setup.models",
"_model" : "Campaigns",
"cloaking" : true,
"campaign_name" : "DOS",
"rotate_urls_status" : false,
"affiliate_url" : "http://www.DOS.com/[[subid]]"
}
],
"category_name" : "category2"
}

how can I append a embed document into landing_page using django-nonrel, mongoengine without djangodbindexer support?? I have tried this but I always receive errors:
landingpage = LandingPages(nickname=lpnickname,url=lpurl)
b = Categories.objects.get(id=affnetworkid,campaigns__campaign_name=campaignname)
b.landing_page.append(landingpage)
b.save()

The mongoengine documentation says that doble underscore is supported, but, the fact is that django-nonrel or the mongoengine is trying to execute a join which is not what I'm looking for, how can I use dot notation on this??
how can I just add more documents to the landing_page list type inside campaigns???
thanks
note: I have 8 days trying to achieve this.

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