Cosmos DB hybrid data APIs access (MongoDB & Gremin) - azure-cosmosdb

Is it possible to add data with the MongoDB APIs, then add edges between the documents with Gremlin, and query the same data with both APIs?

This is not possible today due to MongoDB's use of BSON which is not standard JSON. It is technically possible however to have SQL and Gremlin API within Cosmos DB.

Related

Manage Partition Key in Azure Cosmos DB with C# SDK

Is there any way to manage an Azure Cosmos DB collection with partition key that uses the Mongo API directly from c#?
Currently we use Terraform to provision the Cosmos DB account and the database and we use the MongoDB.Driver to administrate collections. To get the Collection (and create it if it does not exist), we use the following syntax:
public IMongoCollection<MyDocument> MyDocumentsCollection =>
Database.GetCollection<MyDocument>("MyDocuments", mongoCollectionSetting);
I do not see any option to set the partition key for the collection and I was expecting to accomplish this with the mongoCollectionSettings. What is the best option to get this working?
I have found the Microsoft.Azure.Cosmos SDK but this is only applicable for Cosmos DB's SQL API.
Also I don't want to start with the method RunCommand but I guess this is the only option...?! Is it?

Is a SQL Azure Table similar to an Azure Cosmos DB Container?

I am using the Cosmos DB SQL API. But I am confused how to migrate my existing SQL DB into Azure Cosmos DB.
Is an SQL Table similar to a Cosmos DB Container. Or do we need to store all SQL table data into one container with different Partition keys?
Do not be fooled by the name. The Cosmos DB SQL API does not allow you to work with Cosmos DB as though it were a relational database.
It is fundamentally a JSON document database, for storing items in a container. It is schema-less. Whilst you can import data after a fashion (as #Bob linked), you don't end up with relational tables - it's all JSON documents.
The SQL API allows you to use a SQL like syntax to query the JSON structure - the semantics however, are all based on these hierarchically structured documents, allowing you to return arrays of the JSON documents or projections of them.
Queries always run in the context of a specific container.
You can't JOIN across documents for example - you use JOINs to self-join within individual documents. There is basic aggregation across documents, and some limited grouping functionality.
The semantics are very different from SQL Azure; you need to think differently.
Cosmos DB Data Migration tool can be used to import data from SQL Server into Cosmos DB. Refer this link
A Cosmos DB Container is not similar to a SQL Server Table. You can import data from multiple tables in a database into a single Cosmos DB container.

How do I change API in cosmosDB?

I have a cosmosDB with mongo API, however there are many features not supported in this API so I want to switch to SQL API?
As things stand today it is not possible to switch you account from one type to another.
This is what you need to do if you need to switch to the SQL API:
Create a SQL API Cosmos DB Account
Download the Cosmos DBmigration tool
Migrate all the data from the MongoDB account to the SQL API account
Delete the MongoDB account

Creating a Graph Collection with an existing CosmosDB Account

I have an existing CosmosDB Account which was originally set up for the SQL api. I would like to create a graph but keep/manage it under the same database account.
I would like to use the Gremlin.Net sdk which (if I understand properly) requires the 'https://my-account.gremlin.cosmosdb.azure.com:443/' endpoint. Do all collections have this endpoint, or only collections created with an account targeting the gremlin api?
A better way of doing this would be
Create a new Graph account ( this will create the required gremlin server endpoint)
Migrate existing data using graph bulk executor.
Jayanta

MongoDB in Azure Cosmos DB

I was wondering if MongoDB is fully supported in Azure Cosmos DB through the MongoDB API https://learn.microsoft.com/es-es/azure/cosmos-db/mongodb-introduction
I have read that the aggregation pipeline, map-reduce and the full-text indexes is not fully integrated. Does anyone have further information about it? Would you use MongoDB in Azure Cosmos DB considering its current status?
Cosmos DB implements MongoDB wire protocol and many customers already use MongoDB API in production. Aggregation pipeline is in private preview and you can enable it by emailing askcosmosmongoapi#microsoft.com. Map-reduce functionality is mostly covered by aggregation pipiline. Full-text search is partially available through Azure Search, which can index MongoDB collections and $regex operator within MongoDB API covers less complex text search. You can find some other feature requests and their status at https://feedback.azure.com/forums/263030-azure-cosmos-db/category/321994-mongodb-api
Cosmos DB's MongoDB layer implements a large subset of native MongoDB functionality. Specifics of supported features are published here.
You mentioned aggregation pipeline: As of November 2017, this is now supported.
Regarding "current status" of the Cosmos DB MongoDB API: It's a production database with SLA. You'll need to make your own decision on whether to use it, based on feature set and your app's needs.
You can activate aggregation pipeline through Azure portal by going to Preview Features menu.

Resources