a8m / documentdb

Go driver for Microsoft Azure DocumentDB
MIT License
33 stars 25 forks source link

How to get the "coll_self_link" without iterating through the databases and collections queries? #29

Closed fjanon closed 2 years ago

fjanon commented 4 years ago

Is there a way to get the "coll_self_link" without iterating through the databases and collections queries? For example, if I know the database and collection names, how can I issue the QueryDocuments call directly:

_, err = client.QueryDocuments( "coll_self_link", documentdb.NewQuery("SELECT * FROM ROOT r WHERE r.name=@name", documentdb.P{"@name", "john"}), &users, )

I tried a URL like specified in the REST API: 'https://{databaseaccount}.documents.azure.com/dbs/{db}/colls/{coll}'

but I get a "BadRequest, Request url is invalid." error.

The same question is also valid for databases and collections.

Thanks.

ItalyPaleAle commented 2 years ago

36 should fix this too :)