I'm new to Cassandra and to FluentCassandra (C#.NET) too. I have heavy concepts of RDBMS (relational databases), like Microsoft SQL.
Well... i was able to do some simple code, but, that is far of what i do when consulting with ADO.NET in RDBMS.
What i did:
var context = new CassandraContext(keyspace: "keyspace", host: "ipAddress"))
var columnFamily = context.GetColumnFamily("Test");
var record = records.Get("joao").FirstOrDefault();
foreach (FluentColumn colunm in record.Columns)
{
Console.WriteLine("{0}", colunm.ColumnValue);
}
Well, the row i have the key "joao" is a CompositeColumn, but the result went to me as a linear sequence os columns, like you can see at the foreach stantement.
Well, now you know all this, i can expose my doubts:
How can i apply filters like say something like:
select Name, Birthday, Age, MiddleName, LastnName,
from Test
where Key = 'joao'
and Age > 18
I dont know how to do it using FluentCassandra. Can i use the .Get() method to do that? If yes, how? Remember i have Composite columns, i dont know too how to work with them in FluentCassandra...
If i was using ADO.NET for example i just wad do something like:
SqlConnection connection = new SqlConnection("connectrion string");
string query = "select Name, Birthday, Age, MiddleName, LastnName, from Test where Key = 'joao' and Age > 18";
SqlDataAdapter adapter = new SqlDataAdpter(connection, query);
Dataset users = new datSet();
adapter.Fill(users);
After this i had all the information in "users" DataSet object.
I really would like to perform the same oprations on Cassandra database using FluentCassandra, but i'm a little (well, much) lost. I spent a lot of time searching for this, but no success, the documentation and examples are poor...
Does anyone can help, please?
Thanks.
Well, i did:
var context = new CassandraContext(keyspace: "KeySpace", host: "IpAddress");
var results = context.ExecuteQuery("select * from Test");
And i have the return, but what is returned is just the KEY column, the others columns doesn't.
I tried others ways to do the select but all that have the same result: just the rows with only the KEY of the row.
Any idea?
Thanks.