Tuesday, 2 May 2017

Rethinkdb query for data between 2 dates dynamic

I am doing a test with AVA.JS that makes a request to compare that the rows are deeply the same in both my javascript class and RethinkDb json

The following is my error in the Nodejs console

Difference: Object { - createdAt: "Tue May 02 2017 13:35:48 GMT-0500 (Hora est. Pacífico, Sudamérica)", + createdAt: "Tue May 02 2017 12:59:08 GMT-0500 (Hora est. Pacífico, Sudamérica)", description: "#awesome", id: "6a238b19-3ee3-4d5c-acb5-944a3c1fb407", publicId: "3ehqEZvwZByc6hjzgESD5p", src: "http://user.test/3ehqEZvwZByc6hjzgESDp.jpg", Test.<anonymous> (test/pictures-test.js:16:5) step (test/pictures-test.js:29:191) npm ERR! Test failed. See above for more details.

code class javascript

export default { getImage () { return { id: '6a238b19-3ee3-4d5c-acb5-944a3c1fb407', publicId: '3ehqEZvwZByc6hjzgESD5p', userId: 'user', src: 'http://user.test/3ehqEZvwZByc6hjzgESD5p.jpg', description: '#awesome', tags: ['awesome'], createdAt: new Date().toString()// date is dynamic } } }

code json RethinkDb

{ "createdAt": "Tue May 02 2017 13:35:48 GMT-0500 (Hora est. Pacífico, Sudamérica)" , // stored date "description": "#awesome" , "id": "6a238b19-3ee3-4d5c-acb5-944a3c1fb407" , "publicId": "3ehqEZvwZByc6hjzgEZU5p" , "src": http://user.test/3ehqEZvwZByc6hjzgESD5p.jpg, » "tags": [ "awesome" ] , "userId": "user" }

How should I create the createdATAT dynamic field in rethinkDb so that it does not show error?

thanks



via Juan Diego Silva

No comments:

Post a Comment