Coder Social home page Coder Social logo

adarshasnah / mongoose-rest-query Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 54 KB

Restify your mongoose model

Home Page: https://adarshasnah.github.io/mongoose-rest-query/

License: MIT License

JavaScript 100.00%
mongoose mongodb nodejs express expressjs restify

mongoose-rest-query's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @adarshasnah
  • ๐Ÿ‘€ Iโ€™m interested in ...
  • ๐ŸŒฑ Iโ€™m currently learning ...
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on ...
  • ๐Ÿ“ซ How to reach me ...

mongoose-rest-query's People

Contributors

adarshasnah avatar nadeemramsing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nadeemramsing

mongoose-rest-query's Issues

BUG: controller > aggregate > parse(req.body)

BUG: number getting transformed into ObjectId.

What I did (from Angular App):
code_2018-06-29_14-15-03

Error passed into aggregate's cb (and consoled in Chrome > Debugger):
code_2018-06-29_14-12-38

Value before "parse":
code_2018-06-29_14-09-08

Value after "parse":
code_2018-06-29_14-10-55

Cause of bug:
code_2018-06-29_14-14-35

ENHANCEMENT: controller > aggregate > parse(req.body) > ISOString

Description:

For equality comparisons to work when using aggregate with dates, Date instances must be used instead of "string" (even if it's in the ISOString form).

Proof:

Testing using "string"
javaw_2018-07-03_10-05-04

Testing using Date instances
javaw_2018-07-03_10-04-19

Tried and failed workaround:

Using Date instances from client app
code_2018-07-03_10-03-27

Automatically gets converted to "string" (most probably by Angular's internal methods)
chrome_2018-07-03_10-01-49

Inspected interceptor, but no conversion done here
chrome_2018-07-03_10-07-55

Proposed solution:

Adding "ISOString to Date" conversion
code_2018-07-03_10-33-54

Note: https://github.com/honeinc/is-iso-date used to check if a string is an ISOString,

Before conversion
code_2018-07-03_10-35-47

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.