Thanks for clarifying. I'm hoping that the custom binary protocol between 
ArangoDB and drivers (C++ and Javascript at least) will be implemented at 
the future so full VelocyPack power can be used there. The JSON converter 
still can be embedded as many applications are happy with it.

BTW: Some simple things can be used to transpile C++ VelocyPack protocol to 
the Javascript - http://leaningtech.com/cheerp 

It can be used for seamlessly integrating some C++ VelocyPack stuff to the 
FOXX and NodeJS driver for example

Cheers, Rus

пятница, 17 марта 2017 г., 9:50:25 UTC+2 пользователь Jan написал:
>
> Hi,
>
> there currently is no way to inspect the datatypes of an existing document 
> in a collection.
>
> However, collections in ArangoDB store document data only in VelocyPack 
> format.
> However, when a JSON HTTP request comes in, it will be parsed with 
> VelocyPack's JSON parser and converted to VelocyPack data automatically.
> In this step the automatic type mapping is applied that I described in my 
> previous answer.
> From then on, the document data will be passed around internally as 
> VelocyPack data.
> It may be converted back to JSON when the server sends the HTTP response 
> back to the client, and the client expects content-type JSON. Again, there 
> will be the automatic type mapping as described earlier.
>
> It is correct that VelocyPack has support for more datatypes than JSON 
> has, for example binary data and datetime values.
> But currently these extra datatypes cannot be used in ArangoDB for the 
> following reasons:
> - the APIs for incoming data are mostly JSON-based, and JSON has no 
> support for extra datatypes
> - when sending HTTP responses, data may need to be converted back to JSON, 
> which again has no support for extra datatypes. this may sound like a minor 
> issue, but the ArangoDB web interface makes heavy use of JSON-based data 
> exchange with the server, and this is not trivial to change
> - AQL functions and Foxx have not yet been prepared to handle the extra 
> datatypes
>
> So with VelocyPack we have modified the internal storage to be ready for 
> storing all required datatypes. What is currently missing is the protocol 
> level (there we need to find a way to get the extra types into JSON or from 
> JSON) plus AQL functions and Foxx. It's on or list to do this, but 
> currently there is no ETA for this.
>
> Best regards
> Jan
>
>
> Am Donnerstag, 16. März 2017 23:32:05 UTC+1 schrieb Rus Brushkoff:
>>
>> Hello,
>>
>> I thought that VelocyPack datatypes are stored in collection as is and 
>> are not limited to the dumb JSON mapping ones - for example: date one 
>> (0x1c). I'm not sure that current client API's directly support 
>> VelocyStream but seems like this is will happen in near future.
>>
>> So the question remains: how to see what exact VelocyPack datatypes the 
>> particular document in collection has ? How to know that document is stored 
>> effectively (especially after weird JSON mapping) ?
>>
>> понедельник, 13 марта 2017 г., 10:04:48 UTC+2 пользователь Jan написал:
>>>
>>> In ArangoDB there is an automatic mapping from JSON datatypes to 
>>> VelocyPack datatypes and back:
>>>
>>> - JSON null: 0x18
>>> - JSON boolean: 0x19 or 0x1a
>>> - JSON number: 0x1b (floating point), 0x20 - 0x3f  (integers)
>>> - JSON string: 0x40 - 0xbf
>>> - JSON array: 0x01 - 0x09 or 0x13
>>> - JSON object: 0x0a - 0x0e or 0x14
>>>
>>> I am not sure if this is what you need. If not, could you supply further 
>>> information on what kind of type mapping you are interested in (and in 
>>> which place i.e. ArangoDB server or client driver)?
>>> Thanks
>>> Jan
>>>
>>>
>>> Am Samstag, 11. März 2017 07:55:53 UTC+1 schrieb Rus Brushkoff:
>>>>
>>>> Hello,
>>>>
>>>> Is it possible to see the mapping of the document attributes to 
>>>> velocypack datatypes (> 3.x I think) ? It would be useful for debug and 
>>>> optimization process.
>>>>
>>>> TIA, Rus
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to