cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Error while Importing from JSON file

sai1
Node Link

I am trying to import data using

call apoc.import.json("file://posts.json") yield value

but I noticed a strange conversion happening with the timestamps. I have to get something like shown below

{
  "_id": {
    "$oid": "5b1c297bf8e9d1330cb3bafc"
  },
  "text": "what is the opposite of long live the king?",
  "userId": {
    "$oid": "5b1bfbbff8e9d1330cb3baa2"
  },
  "lat": null,
  "long": null,
  "asset": "HyzKFiYeQ",
  "type": "image/png",
  "createdAt": 1528572283809,
  "updatedAt": 1528572331336,
  "deletedAt": 1529309238872,
  "comments": 2
}

but I am getting this in neo4j

{
  "type": "image/png",
  "userId": {
    "$oid": "5b1bfbbff8e9d1330cb3baa2"
  },
  "long": null,
  "createdAt": -436073567,
  "deletedAt": 300881496,
  "_id": {
    "$oid": "5b1c297bf8e9d1330cb3bafc"
  },
  "text": "what is the opposite of long live the king?",
  "asset": "HyzKFiYeQ",
  "updatedAt": -436026040
}

I see createdAt , updatedAt , deletedAt changed. what is that I am missing here

1 REPLY 1

Hi Sai, have you seen the Date/Time formats and conversions here? https://neo4j.com/docs/labs/apoc/current/temporal/datetime-conversions/

I think there should be a problem in how Neo4j understands the date format.