DEV Community

Discussion on: Introduction to Loopback 4 and MongoDB

Collapse
 
mtruon11 profile image
Minh Truong

Hi Matt,

Thank you for writing this article. This is very helpful.

I am currently using Loopback 4 and Azure cosmos db 3.6 with mongodb. I am not very sure you are familiar with azure cosmosdb. 3.6 is the latest version and it only automatically indexes _id field but not other fields in the collection. While 3.2 does index every fields. My question is how do I create an index in loopback 4 using the datasource or repository.

Thanks again.

Collapse
 
fmgordillo profile image
Facundo Martin Gordillo

This might be late, but here you can find all that you need (and if not, there's issues for you): github.com/strongloop/loopback-con...

But short answer might be "you can't", because this is just a connector (in contrast to mongoose that is an ORM between your backend and MongoDB). Hope it helps