#Mongo how to createIndex

1 messages · Page 1 of 1 (latest)

hallow schooner
#

My project requires the collection to have a unique index to prevent duplicates. I'm not finding any docs on this particular use case. Can anyone help? I found some possibly old stuff about a query option called Run JS but that appears to be gone now? Would I somehow use the Raw option to perform the createIndex operation? I cannot find examples of this.

bright carbonBOT
#

Hey There,

We've registered your query, and our team will get back to you soon.

Regards,
Pranav

bright carbonBOT
#

Hello, could you please explain your use case in a bit more detail and share
some screenshots of your current configuration, as well as those documents you
mentioned?

hallow schooner
#

I want to use createIndex to prevent duplicates. Simple as that. It's a very common Mongo method.

bright carbonBOT
hallow schooner
#

Hmm, that means I would need to set up the collection ahead of time as well, which Mongo supports created the collection if it's missing. This really should be part of appsmith.

#

Or at least expose access to the DB via JSObjects. Then it'd be quite easy to do.

#

This missing from AppSmith means I have to get DevOps involved. 👎