We are using the storage service and are parsing a Unity C# object into a JSON string. Not all properties of the object are used on every call, and therefore sometimes the attributes contain null when parsed to JSON. What we are seeing is that when there are null values in the attributes, the service call fails:
storageService.InsertJSONDocument(ofDatabaseName, ofEventCollectionName, json.ToString());
{"app42Fault":{"httpErrorCode":400,"appErrorCode":2605,"message":"Bad Request","details":"Passed JSON string '{\"SessionId\":null,\"LaneName\":null,\"Details\":null,\"RangeName\":null,\"ContentId\":null,\"_$acl\":[{\"PUBLIC\":\"R\"}],\"ShotX\":-1,\"_$updatedAt\":\"2014-07-01T16:11:13.784Z\",\"EventType\":\"Shot\",\"ShotY\":-1,\"EventDate\":\"/Date(1404231074630-0400)/\",\"Username\":\"test_0\",\"GameMode\":\"Practice\",\"_$owner\":{\"owner\":\"_App_Admin_User\"},\"_$createdAt\":\"2014-07-01T16:11:13.784Z\"}' is not valid."}}
Can we not save null values into App42 even though null is a valid value both in JSON and in NoSQL? How can we work around this without having to cycle check the values on every request? There are a ton of these writes occurring and we cant check the properties of the serialized object on every request.