I am trying to update or insert (if it does not exist) an element in the database but so far I have not found any examples on how to use the Update
and Filter
provided by the C# Api.(C# Api , not RethinkDB Reql).
Link to api : https://github.com/bchavez/RethinkDb.Driver
Can anyone help me ?
POCO
class Player
{
public long playerId { get; set; }
public long groupId { get; set; }
public int type { get; set; }
public double lat { get; set; }
public double lng { get; set; }
}
class PlayerRequest
{
public Player data { get; set; }
public Auxdata aux { get; set; }
}
This would be the insert request:
dynamic rez = await r.Db(Constants.DB_NAME).Table(Constants.TABLE_CLIENT)
.Insert(playerRequest.data).RunAsync(Con);
I need to perform an update of playerRequest.data
based on the playerId
or insert the Player
if it does not exist.
I have searched the Api but so far no success.
P.S I have tried installing the Linq to ReQL extension, but the methods seam to be unavailable.