Skip to content

Question about switch_collection #1098

Open
@muhammedabad

Description

@muhammedabad

Hi,

I'm quite new to mongodb and mongoengine and particular. We're looking at developing a multi tenanted django application that uses a single database, while giving each client their own collections for each of our models, eg:

client_1_products
client_1_orders

client_2_products
client_2_orders

What we would like to be able to do is easily change the collection name based on the client that using the app (each client would be assigned a collection prefix on registration). I have looked at the switch_collection() function, but I'm not sure if it's the best way to go about this. The site will be used by hundreds of people at the same time, so from a performance perspective I need to ensure that this does not impact negatively.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions