You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi
I know that mongo creates things on the fly. But I would like to have
some script for creating schema (db) collections, and each time that
new schema (db) is created (on the fly) mongo will automatically
execute this script. So my code will be unaware of indexes and sharing
configuration. Can I do such thing, and how?
Adam C
unread,
May 1, 2012, 7:47:50 AM5/1/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com
Not 100% sure what you mean by creating things on the fly, but it sounds like you want triggers on the server. There is a request tracking this that you can watch and vote for:
But again, you're a little vague about what you are trying to accomplish.
Adam
Yulias Stolin
unread,
May 1, 2012, 4:20:20 PM5/1/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
I have an application with multiple accounts. In each account i have
the same tables.
The account could be created dynamically (this is rare event no
special business logic on that)
But in other hand i didn't want to treat at the code the new account
creation, and then ensure an index for the collections, and configure
their shard definition
So I wanted something automatic in mongo. Probably it is not possible
Scott Hernandez
unread,
May 1, 2012, 5:28:00 PM5/1/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com
This is best put in your business logic/code when new accounts are created.
Wherever the code is that uses the database for the first time could
also set everything up correctly before.