![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
cosmos-db-writer-ssl-fixed-aad
Advanced tools
This module is for performing CRUD operations into azure cosmos DB.
This module is for performing CRUD operations into azure cosmos DB.
npm install cosmos-db-writer --save
const cosmosDB = require('cosmos-db-writer');
let options = {
//Cosmos db endpoint
endpoint:"",
//cosmos db primary key for your subscription
primaryKey:"",
//name for your database
dbName:"",
//name for your container
containerName:"",
// container paths for multi country database for ex. ["/Country"]
containerPaths: [],
// throughput for your transactions ex. 400
throughput:400,
// environment you are working into, example local, others
environment:""
}
cosmosDB.init(options, function(error){
// check for error.
});
//Normal fields to write in cosmos db
let dataFields = {"key1":"value1","key2":"value2"};
//fields to be read from request context which you have set
// here key will be the field name in cosmos db and value will be thekey for request context
// for example {"userId":"request:userId"}
let requestFields = {"key1":"value1","key2":"value2"};
let dataOptions={
"dataFields":dataFields,
// this field is optional, use it only if you are setting some request context fields like userId
"requestFields":requestFields
}
// containerName and callback is optional for write operation default container is the one you initialized in init method.
cosmosDB.write(dataOptions,[containerName] ,[callback]);
// *****************query data from container********************* /
let options = {};
options.clauses = [];
// set where clauses for your query, operator is for field and value, Logical Operator is for between different clauses
let clause = new cosmosDB.Clause();
clause.setField("field");
clause.setValue("value");
//{'EQ':'=', 'NEQ':'!=', 'GT':'>', 'LT':'<', 'GTE':'>=', 'LTE': '<=', 'NEQD':'<>'}
clause.setOperator(clause.operatorEnum.EQ);
//{'AND':'AND', 'OR':'OR'}
clause.setLogicalOperator(clause.logicalOperatorEnum.OR);
options.clauses.push(clause);
});
// pass fields which you want to retrieve
options.fields = ["id","userId","emailId","taskId"];
// set
options.orderBy = {"field":"id", "order":"DESC"};
cosmosDB.query(options,[containerName],function(err, response){
//handle error and response here
});
// ********read specific item, it will with partition key as of now *********** /
let options = {};
options.id = "1233"// id of item to read
options.partitionKey = "India" // value for the partition key for ex India, if your partion key is country
cosmosDB.read(options,[containerName],function(err, response){
//handle error and response here
});
// *****************partial update an existing Item -- Partial update require partition key ******* /
let options = {};
options.id = "123";
options.partial= true;
options.updateFields =[{"name":"taskId","value":"12345"}],// give the list of properties you want to update withe the mentioned new value
options.partitionKey = "India" // value for the partition key for ex India, if your partion key is
cosmosDB.partialUpdate(options,[containerName],function(err, response){
//handle error and response here
}
// ********************* update an existing Item -- full update require complete itemBody ********* /
let options = {};
options.id = "123";
options.partial= false;
options.itemBody = {
"id":"123",
"name":"name of item"// pass complete object to relace the existing item
}
cosmosDB.update(options,[containerName],function(err, response){
//handle error and response here
}
// *************** delete an item ********** /
let options = {};
options.id = "123";
options.partitionKey = "India" // value for the partition key for ex India, if your partion key is
cosmosDB.delete(options,[containerName],function(err, response){
//handle error and response here
}
1.1.0.
Ankit Choudhary
MIT
Hat tip to anyone whose code was used
FAQs
This module is for performing CRUD operations into azure cosmos DB.
The npm package cosmos-db-writer-ssl-fixed-aad receives a total of 13 weekly downloads. As such, cosmos-db-writer-ssl-fixed-aad popularity was classified as not popular.
We found that cosmos-db-writer-ssl-fixed-aad demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.