Was this questioned ever answered.../

On Monday, February 4, 2013 at 4:09:08 AM UTC-8, Claudio wrote:
>
> Hi Luca,
> yes this was my intention: I would to create an embedded document and I 
> would to create a field inside it as a date field.
> Let's say that the my example could be more clear. What if I try something 
> like this:
>
> insert into myClass (name,meta) values ("claudio",{"country":"italy", 
> "date":"2013-01-01","@fieldTypes":"date=d"})
>
> Thanks
>
> 2013/2/4 Luca Garulli <[email protected] <javascript:>>
>
>> Hi Claudio,
>> the trick you used with @fieldTypes is supposed to work but you're 
>> inserting an entire document as "myDate" attribute. Try this:
>>
>> insert into myClass (myDate) values ( date("2013-01-01 00:00:00") )
>>
>> Lvc@
>>
>>
>>
>> On 3 February 2013 15:49, Claudio <[email protected] <javascript:>> 
>> wrote:
>>
>>> Hi,
>>> is it possible to specify the type of a field in an embedded document 
>>> using the @fieldTypes field?
>>> I tried this:
>>>
>>> insert into myClass (myDate) values 
>>> ({"date":"2013-01-01","@fieldTypes":"date=d"})
>>>
>>> Now to check that internally the date field was a Date, I tried the 
>>> following update:
>>> update myClass  increment myDate.date = 1
>>>
>>> I was expecting a java.util.Date CastException, but I had:
>>> Error: 
>>> com.orientechnologies.orient.core.exception.OCommandExecutionException: 
>>> Error on execution of command: OSQLQuery [text=select from MYCLASS]
>>> Error: java.lang.ClassCastException: java.lang.String cannot be cast to 
>>> java.lang.Number
>>>
>>> It seems that internally the date field is a String not a Date.
>>>
>>> Thanks
>>>
>>> -- 
>>>  
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "OrientDB" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected] <javascript:>.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>
>> -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Sent from my Commodore 64
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" 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