Azure-Samples / cosmos-notebooks

Sample Notebooks
24 stars 28 forks source link

Provide an example for MongoDB API for CosmosDB Jupyter Notebooks #42

Open christianrondeau opened 4 years ago

christianrondeau commented 4 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Try to connect to mongodb from a Jupiter notebook in CosmosDB

Any log messages given by the failure

See description. I was unable to find how to proceed (no documentation or examples)

Expected/desired behavior

An example, OR documentation on how to connect to CosmosDB Mongo API

OS and Version?

Windows 10 (but I'm using the Jupyter Notebooks from Azure Portal)

Versions

The explorer version was 332d5dcbcb2fd3b9aba8172ece37915468631577, not sure how to get the CosmosDB "version".

Mention any other details that might be useful

While everywhere it says that the Mongo API will work for Jupyter Notebooks in CosmosDB, there's no documentation to be found on how to actually use it (%%sql indeed does not work)

https://azure.microsoft.com/en-us/blog/analyze-and-visualize-your-data-with-azure-cosmos-db-notebooks/ [quote] Cosmic notebooks are available for all data models and APIs including Cassandra, MongoDB, SQL (Core), Gremlin, and Spark to enhance the developer experience in Azure Cosmos DB. These notebooks are directly integrated into the Azure Portal and your Cosmos accounts, making them convenient and easy to use.

And here it says it's not supported:

https://docs.microsoft.com/en-us/azure/cosmos-db/use-notebook-features-and-commands

It says to install dependencies like this:

import sys
!{sys.executable} -m pip install PackageToBeInstalled –user

But it doesn't work either:

Defaulting to user installation because normal site-packages is not writeable
ERROR: Invalid requirement: '–user'

Anyway it's unclear whether we should put the cosmos secrets in the Jupiter notebooks to use the Mongo API.

It this is indeed supported, at least one very simple example would be warranted.

mekinney commented 3 years ago

Would love to see a response to this. Documentation for what works with Mongo API is needed.