David Westbrook
Posts: 0
Joined: Sat Sep 28, 2013 8:22 pm

Collection indexes

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Collection indexes

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.

David Westbrook
Posts: 0
Joined: Sat Sep 28, 2013 8:22 pm

Collection indexes

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Collection indexes

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

David Westbrook
Posts: 0
Joined: Sat Sep 28, 2013 8:22 pm

Collection indexes

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Collection indexes

Yes, it's a good feature to add.

Willie Sims
Posts: 0
Joined: Wed Jul 10, 2013 4:37 pm

Collection indexes

Has this been implamented

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Collection indexes

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

Image

David Westbrook
Posts: 0
Joined: Sat Sep 28, 2013 8:22 pm

Collection indexes

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...

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Collection indexes

Hi David,

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

Return to “Issues”