I have a cassandra database with a keyspace that looks like:
CREATE TABLE custumer_events_service.events(
acceptFirstContactDuration decimal,
currentTime timestamp,
visitorIdentifier text,
PRIMARY KEY (visitorIdentifier, currentTime)
) WITH CLUSTERING ORDER BY (currentTime DESC);
And a python dict
{u'acceptFirstContactDuration': 0,
u'currentTime': u'2016-02-18T11:51:55.468Z',
u'12eca72928845aae26268f431b8c75b2564d7919c916e',}
Is there a way to insert this dict directly with cassandra-driver
? I am looking for something like in mongodb
>>> import datetime
>>> post = {"author": "Mike",
... "text": "My first blog post!",
... "tags": ["mongodb", "python", "pymongo"],
... "date": datetime.datetime.utcnow()}
>>> posts = db.posts
>>> post_id = posts.insert_one(post).inserted_id