The long overdue capability to support free-form data objects inside rethinkdb-net without relying on the rethinkdb-net-newtonsoft add-on library. This will also add many dictionary operations to the key capabilities.
[x] Support converting Dictionary<string,object> round-trip to RethinkDB.
[x] Automatically detect the best object type to deserialize for a given RethinkDB value.
[x] numbers -> double or int
[x] objects:
[x] special case: byte array
[x] special case: DateTimeOffset
[x] named value collection
[x] string
[x] bool
[x] arrays....
[x] string arrays -- all types are string or null gets a string[]
[x] number arrays -- all types are int gets in int[], all types are int or null gets an int?[], all types are int or double gets a double[], all types are int or double or null gets a double?[]
[x] all types are the same and or null, and the type is a reference type, gets a TReferenceType[]
[x] all types are the same and or null, and the type is a value type, gets a TValueType?[]
[x] throw an error; unable to find a homogenous array type. In the future, maybe we'd support a heterogeneous type like object[]
[x] Dictionary operations:
[x] .ContainsKey(...)
[x] .ContainsValue(...) No ReQL operation for this (and, why would you want to anyway?)
[x] Count property No ReQL operation to find the number of keys in an object.
[x] Keys property
[x] Values property
[x] Item accessors; eg. dictionary[key], for getting.
[x] Item accessors; eg. dictionary[key], for setting. Doesn't return a Dictionary type, so can't make it work in a LINQ expression. Created an alternative instead (next point).
[x] Extension method to set a dictionary value in an Update query; dict.SetValue(key, value).SetValue(key2, value2)
[x] .Add(...) method Returns void, can't use; however, SetValue extension method above does same functional capability.
[x] .Remove(...) method No exact match for this in ReQL, but, did implement .Without() to exclude a key from a dictionary.
[x] Do useful things with the values of a dictionary; since they're of type object, this might require supporting casts in the expression converter. eg. .Filter(o => (int)o.FreeformProperties["awesome level"] > 10)
[x] Update release notes.
[x] How hard would it be to support dictionaries other than <string,object> now that most of the above work is done? --> easy; this has been implemented. Dictionary values can now be strongly typed or weakly typed by using System.Object.
The long overdue capability to support free-form data objects inside rethinkdb-net without relying on the rethinkdb-net-newtonsoft add-on library. This will also add many dictionary operations to the key capabilities.
Dictionary<string,object>
round-trip to RethinkDB..ContainsKey(...)
No ReQL operation for this (and, why would you want to anyway?).ContainsValue(...)
No ReQL operation to find the number of keys in an object.Count
propertyKeys
propertyValues
propertydictionary[key]
, for getting.Item accessors; eg.Doesn't return a Dictionary type, so can't make it work in a LINQ expression. Created an alternative instead (next point).dictionary[key]
, for setting.dict.SetValue(key, value).SetValue(key2, value2)
Returns void, can't use; however, SetValue extension method above does same functional capability..Add(...)
methodNo exact match for this in ReQL, but, did implement.Remove(...)
method.Without()
to exclude a key from a dictionary..Filter(o => (int)o.FreeformProperties["awesome level"] > 10)