Giter VIP home page Giter VIP logo

azure-cosmos-db-cassandra-nodejs-getting-started's Introduction

page_type languages products description urlFragment
sample
javascript
azure
Azure Cosmos DB is a globally distributed multi-model database. One of the supported APIs is the Cassandra API.
azure-cosmos-db-cassandra-nodejs-getting-started

Developing a Node.js app with Cassandra API using Azure Cosmos DB

Azure Cosmos DB is a globally distributed multi-model database. One of the supported APIs is the Cassandra API. This sample walks you through creation of keyspace, table, inserting and querying the data.

Running this sample

  1. Clone this repository:

    git clone [email protected]:Azure-Samples/Azure-Samples/azure-cosmos-db-cassandra-node-getting-started.git cosmosdb
  2. Change directories to the repo:

    cd cosmosdb
  3. Install npm dependencies:

    npm install
  4. Next, substitute the contactPoint, username, password, and Azure region in config.js with your Cosmos DB account's values from the Azure portal. Find REGION on the Overview page as Read locations. The remaining settings are on the Settings -> Connection string page.

    module.exports = {
        username: 'USERNAME',
        password:
          'PRIMARY-PASSWORD',
        contactPoint: 'CONTACT-POINT',
        keySpace: "uprofile",
        localDataCenter: "REGION"
    };
  5. Run uprofile.js in a terminal to start your start your node application:

    npm start

About the code

The code included in this sample is intended to get you quickly started with a Node.js console application that connects to Azure Cosmos DB with the Cassandra API.

More information

azure-cosmos-db-cassandra-nodejs-getting-started's People

Contributors

diberry avatar kanshig avatar kansrini avatar microsoftopensource avatar mimig1 avatar msftgits avatar snehagunda avatar theovankraay avatar zanasrin avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-cosmos-db-cassandra-nodejs-getting-started's Issues

[Action Needed] This repo is inactive

This GitHub repository has been identified as a candidate for archival

This repository has had no activity in more than [x amount of time]. Long periods of inactivity present security and code hygiene risks. Archiving will not prevent users from viewing or forking the code. A banner will appear on the repository alerting users that the repository is archived.

Please see https://aka.ms/sunsetting-faq to learn more about this process.

Action

✍️

❗**If this repository is still actively maintained, please simply close this issue. Closing an issue on a repository is considered activity and the repository will not be archived.🔒

If you take no action, this repository is still inactive 30 days from today it will be automatically archived..

Need more help? 🖐️

Sample doesn't work anymore - Time to update!!

it has 3 fields and looks like you are trying to add 4 that raises a undefined error..

 {
            query: 'INSERT INTO  uprofile.user  (user_id, user_name , user_bcity) VALUES (?,?,?)',
            params: [1, 'LyubovK', 'Dubai', '2017-10-3132']
        },

After removing dates in query,

There was an error Logged batches are not supported by the service yet. Please use unlogged batches instead. ResponseError: Logged batches are not supported by the service yet. Please use unlogged batches instead.
    at FrameReader.readError (C:\Workspace\cassandracosmos\node_modules\cassandra-driver\lib\readers.js:326:15)
    at Parser.parseBody (C:\Workspace\cassandracosmos\node_modules\cassandra-driver\lib\streams.js:194:66)
    at Parser._transform (C:\Workspace\cassandracosmos\node_modules\cassandra-driver\lib\streams.js:137:10)
    at Parser.Transform._read (_stream_transform.js:190:10)
    at Parser.Transform._write (_stream_transform.js:178:12)
    at doWrite (_stream_writable.js:410:12)
    at writeOrBuffer (_stream_writable.js:394:5)
    at Parser.Writable.write (_stream_writable.js:294:11)
    at Protocol.ondata (_stream_readable.js:663:20)
    at Protocol.emit (events.js:182:13)

I came-up with below sample which works currently...
https://gist.github.com/prashanthmadi/afba93b4871fd8e79f22e13ecf05ecfc

Missing information in Readme.md causing sample not to work

Please provide us with the following information:

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

- [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

The Readme.txt states wrongly that you just need to adapt config.js.
In uprofile.js there is this code:

var ssl_option = {
  cert : fs.readFileSync("path\to\cert"),
  secureProtocol: 'TLSv1_2_method'
};

Either extend the guide in readme.txt or offer this code as alternative

// For SSL provide a certificate:
// var ssl_option = {
//   cert : fs.readFileSync("path\to\cert"),
//   secureProtocol: 'TLSv1_2_method'
//  };
// For SSL without validation use:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var ssl_option = { rejectUnauthorized: false };

Any log messages given by the failure

Expected/desired behavior

Working sample

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Could you please Provide code snippet for Typescript

Please provide us with the following information:

Can't use above code while using Typescript


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

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

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.