Oddity with dates and property key naming #2447
-
Using the gremlin console I issue these two queries: // `created_at`
g.addV("test").property("created_at", new Date())
// `createdAt`
g.addV("test").property("createdAt", new Date()) Both vertices get created successfully, however the one using Does anyone know the reason for this behaviour? What am I doing wrongly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I managed to solve it myself, as expected was my mistake. It turns out that I had previously created some vertex properties using It seems like the best way of avoiding this would have been to set up my schema in advance as recommended in the docs (the only reason I didn't do this is because I'm playing around at this point) |
Beta Was this translation helpful? Give feedback.
I managed to solve it myself, as expected was my mistake.
It turns out that I had previously created some vertex properties using
created_at
with a string, which had the side effect of creating a schema. Any subsequent calls cast the date into a string.It seems like the best way of avoiding this would have been to set up my schema in advance as recommended in the docs (the only reason I didn't do this is because I'm playing around at this point)