Open YuriyKortev opened 3 years ago
Hi,
neomodel.DateTimeProperty
expects float
but you provided str
.
@alexlitvinenko Thanks for answer, i'm not providing anything, i'm just calling
StructuredNode.nodes.all()
and getting error. Property meet_datetime in cypher has datetime type, was created with following command:
m.meet_time=datetime()
Try my example:
class Meet(StructuredNode):
notes = StringProperty()
meet_datetime = DateTimeProperty()
Meet(notes='test1', meet_datetime=datetime.now()).save()
Meet(notes='test2', meet_datetime=datetime.now()).save()
m = Meet.nodes.all()
print(m)
Printed:
[<Meet: {'notes': 'test1', 'meet_datetime': datetime.datetime(2021, 1, 27, 13, 43, 45, 44876, tzinfo=
Then cypher:
match (n:Meet) return n.notes, n.meet_datetime
@alexlitvinenko thanks, but which way i can create meet_datetime in cypher and read by neomodel?
Try this:
CREATE (n:Meet)
SET n.notes = 'test 3'
SET n.meet_datetime = datetime().epochSeconds
return n
This is how to turn obscure float into pretty datetime string:
match (n:Meet) where exists(n.meet_datetime) return apoc.date.format(n.meet_datetime, 's', 'yyyy/MM/dd HH:mm:ss')
@alexlitvinenko it works, thank you!
Hi,
im trying to get list of node in neomodel
m = Meet.nodes.all()
and getting this:
Class definition:
meet_datetime property in database: m.meet_datetime """2021-01-27T11:57:49.477000000Z""" """2021-01-27T11:57:49.477000000Z""" """2021-01-27T11:57:49.477000000Z""" """2021-01-27T11:57:49.477000000Z"""
Thanks in advance.