Bit more progress made today…
Managed to get the Node.JS sample up and running and discovered an undocumented display name field in the schema object was being produced, that stopped the error occurring on connection.
My working Schema files looks like this…
{
“schemas”: [ {
“id”: “Booking”,
“displayName”: “Booking”,
“ttl”: 3600,
“defaultSort”: null,
“allowedOperations”: [“get”, “find”, “count”, “update”, “insert”, “remove”],
“fields”: {
“_id”: {
“displayName”: “_id”,
“type”: “text”,
“queryOperators”: [“eq”, “lt”, “gt”, “hasSome”, “lte”, “gte”, “ne”, “startsWith”, “endsWith”]
},
“BookingID”: {
“displayName”: “BookingID”,
“type”: “number”,
“queryOperators”: [“eq”, “lt”, “gt”, “hasSome”, “lte”, “gte”, “ne”, “startsWith”, “endsWith”]
},
“BookingDate”: {
“displayName”: “BookingDate”,
“type”: “text”,
“queryOperators”: [“eq”, “lt”, “gt”, “hasSome”, “lte”, “gte”, “ne”, “startsWith”, “endsWith”]
},
“Notes”: {
“displayName”: “Notes”,
“type”: “text”,
“queryOperators”: [“eq”, “lt”, “gt”, “hasSome”, “lte”, “gte”, “ne”, “startsWith”, “endsWith”]
},
“VenueID”: {
“displayName”: “VenueID”,
“type”: “number”,
“queryOperators”: [“eq”, “lt”, “gt”, “hasSome”, “lte”, “gte”, “ne”, “startsWith”, “endsWith”]
}
},
“maxPageSize”: 50
}]
}
The Flow of calls seems to be … Schema\List → Schema\Find-> Data\Find
I now have data being pulled in from my SPI - sample data set …
{
“items”: [{
“BookingID”: 670,
“VenueID”: 45,
“BookingDate”: “2019-07-16T00:00:00”,
“Notes”: “Fhfhfh”,
}, {
“BookingID”: 972,
“VenueID”: 9,
“BookingDate”: “2019-07-22T00:00:00”,
“Notes”: “”,
}
],
“totalCount”: 2
}
However latest problem seems to be, when it has imported the schema it has created a field key against which it maps the data which uses a cameCase version of the field name i.e. BookingDate becomes bookingDate.
So when it lists the data it does not map to the correct field (rather creates a new one).
If I modify the Json serialization of the data response to match the camel case it works as expected, however rather than doing this for my entire data model, would be nice if there was a way I could tell it what key to use as part of the schema definition? (I have already tried id & key properties on the field def object).