ARecord..::..ToJson Method
Returns a JObject representing the record as JSON. Each property name will be the corresponding bin name.
The primary key is the PK value or the digest()()()() if the PK Value is not provided/present.
Namespace:
Aerospike.Database.LINQPadDriver.ExtensionsAssembly: Aerospike.Database.LINQPadDriver (in Aerospike.Database.LINQPadDriver.dll)
Syntax
Parameters
- pkPropertyName
- Type: String
The property name used for the primary key. The default is '_id'. If the primary key value is not present, the digest is used. In these cases the property value will be a sub property where that name will be '$oid' and the value is a byte string. If this is null, no PK property is written.
- useDigest
- Type: Boolean
If true, always use the PK digest as the primary key. If false, use the PK value is present, otherwise use the digest. Default is false.
Return Value
Returns a JObject representing the record.Examples
C#
{ "_id": 522, "Tag": "Player", "PlayerId": 522, "UserName": "Roberts.Eunice", "FirstName": "Eunice", "LastName": "Roberts", "EmailAddress": "RobertsEunice52@prohaska.name", "CountryCode": "US", "State": "NJ" }
C#
{ "_id": { "$oid": "0080a245fabe57999707dc41ced60edc4ac7ac40" }, "Tag": "Player", "PlayerId": 522, "UserName": "Roberts.Eunice", "FirstName": "Eunice", "LastName": "Roberts", "EmailAddress": "RobertsEunice52@prohaska.name", "CountryCode": "US", "State": "NJ" }