kiril-me / cassandrom Goto Github PK
View Code? Open in Web Editor NEWCassandra object modeling tool for Node.Js like mongoose
License: Apache License 2.0
Cassandra object modeling tool for Node.Js like mongoose
License: Apache License 2.0
Hello.
I'm directly calling cassandrom.connection.model with the table name and the schema, so I'm sure that if the table not exists it creates it.
But I noticed that this always gives back an error (if the table exists), because the query "SELECT table_name FROM system_schema.tables WHERE keyspace_name=?" always gives back 0 results, and I think it's because the table "system_schema.tables" has just a column and it's called "table_name", and not "keyspace_name".
I'm trying to get started with this library , but i receive an error:
Error during user save: ResponseError: No keyspace has been specified. USE a keyspace, or explicitly specify keyspace.tablename
Furthermore , i've checked the index.js and found that keyspace is deleted.
var keyspace = options.keyspace;
delete options.keyspace;
I've tried to comment the delete options.keyspace
, the first error disappeared but i got another error:
Error during user save: ResponseError: unconfigured table user
Here is my code (from readme). I'm 100% that my cassandra is working correctly and i do not have any tables in db.
cassandrom.createConnection({
contactPoints: [cassandraUri],
localDataCenter: 'datacenter1',
keyspace: 'my-keyspace'
});
var schema = new cassandrom.Schema({
userId: { type: cassandrom.UUIDType, required: true, default: cassandrom.uuid },
fullName: { type: String, required: true, trim: true },
username: { type: String, required: true, unique: true, trim: true },
email: { type: String, required: true, unique: true, trim: true },
password: { type: String, required: true },
date: { type: Date, default: Date.now, required: true }
}, ['userId']);
var User = cassandrom.model("User", schema);
User.create({
fullName: 'John Doe',
username: 'john',
email: '[email protected]',
password: 'doedoe'
}, function (error, user) {
if(error) {
console.log('Error during user save: ' + error);
} else {
console.log('User saved ' + user.userId + ' date ' + user.date);
}
});
I would like to use this library but i can't pass the errors...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.