Page 1 of 2

Collection indexes

Posted: Sat Sep 28, 2013 8:27 pm
by David Westbrook

How do I create a unique index on a Collection to prevent duplicates, and a non unique index on a Collection to improve search performance?


Collection indexes

Posted: Sat Sep 28, 2013 8:29 pm
by maxkatz

Every record has a unique id that's automatically generated -- you can use that. You can also create a new column and generate the number any way you want.


Collection indexes

Posted: Sat Sep 28, 2013 9:09 pm
by David Westbrook

If I create an e-mail address column, and I want the column to be unique, how do I specify that?

Can I specify the value of the _id column, instead of using the value that is automatically generated?


Collection indexes

Posted: Sat Sep 28, 2013 9:37 pm
by maxkatz

You would need to enforce the email uniqueness on the app level. The _id is generated by the database.


Collection indexes

Posted: Sat Sep 28, 2013 10:29 pm
by David Westbrook

MongoDB supports indexes - http://docs.mongodb.org/manual/indexes/. It would be nice if the Collections Maintenance UI allowed indexes to be defined and maintained.


Collection indexes

Posted: Sat Sep 28, 2013 11:14 pm
by maxkatz

Yes, it's a good feature to add.


Collection indexes

Posted: Sat Jan 18, 2014 6:07 am
by Willie Sims

Has this been implamented


Collection indexes

Posted: Sun Jan 19, 2014 5:06 pm
by maxkatz

Yes, when you create a column you can set it as index:

Image


Collection indexes

Posted: Sun Jan 19, 2014 6:23 pm
by David Westbrook

All that Appery.io has appeared to support is Non-Unique Single Field indexes. How about Compound Indexes, and specifying Unique?
http://docs.mongodb.org/manual/core/i...
http://docs.mongodb.org/manual/core/i...


Collection indexes

Posted: Mon Jan 20, 2014 7:05 am
by Kateryna Grynko

Hi David,

You would need to create a service for reading this data.
If there is no such record - add it.