I'm using the datastax C # driver to put a line in the cassandra database, my sample code looks like this :
var cluster = cluster Builder (). Findpointpoint ("localhost"). Create (); (Cluster) using {var connection = cluster. Connect (); Connection.ChangeKeyspace ("development"); Var simple = connection.Prepare (@ "INSERT INTO test (ID, customer, content, created, line_id) value (UUD), 'test customer',?, '2014-10-24',?)") ; Var cmd = simple.Bind ("content", new hashset & lt; guid & gt; {Guid.NewGuid ()}); Var result = connection.Execute (CMD); }
How do I get an ID of the row that I put?
Why not pass IDs in itself? Replace uuid ()
with some guit (by Guid.NewGuid ()
) and you will receive it when you first created it.
Comments
Post a Comment