Skip to content

Inconsistency fetching date properties (http json) #1369

@topofocus

Description

@topofocus

ArcadeDB Version:

23.3.1

OS and JDK Version:

Ubuntu

Expected behavior

Date fields should be transferred as JSON Date representation,
independently if its an adhoc property, an explicitly declared property with or without an index

Actual behavior

In adhoc-mode its stored and fetched as date object.
If the property is declared as date object, its returned as malformatted Unix-time integer, if (and only) accessed via in/out.

Steps to reproduce

create vertex type my_v1 
create vertex type my_v3 extends my_v1 
create edge type my_e1 
CREATE PROPERTY my_v3.datum DATE
INSERT INTO my_v3 CONTENT {"datum":"2014-05-06","a":"eins"}  # --> #175:0
INSERT INTO my_v3 CONTENT {"datum":"2024-05-06","a":"zwei"   # --> #176:0
create edge my_e1 from #175:0 to #176:0 
select from my_v3 where a='eins'                            
=> [{:@rid=>"#175:0", :@type=>"my_v3", :@cat=>"v", :datum=>"2014-05-06 00:00:00", :a=>"eins"}] 
                                                             # datum is a Date object
select out('my_e1') from #175:0     
--> {:datum=>#<Date: 2024-05-06 ((2456784j,0s,0n),+0s,2299161j)>, :a=>"eins", :rid=>"#176:0"} 
# OK if no date property is present

---> [{:"out()"=>[{:datum=>1714953600000, :a=>"zwei", :@cat=>"v", :@type=>"my_v3", :@rid=>"#176:0"}]}]         
# Unix time if a property is declared

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions