Giter Club home page Giter Club logo

Comments (8)

qasim avatar qasim commented on June 15, 2024 2

@kshvmdn some good news on the date parsing, I found out that we can do the number operations on strings in the case of dates and MongoDB will handle it for us as long as both the comparators are strings (which in this case they are). That means I retired date_num and we don't have to deal with that mess in tests anymore too.

from cobalt.

kashav avatar kashav commented on June 15, 2024 1

Only got to take a brief look at this (will test in depth when I get the chance), it looks good so far.

I'm assuming date/time parsing is not complete yet (unless the plan is to ignore invalid input, in which case, this value needs to be returned).

I think mapreduce looks fine, we might be able to wrap filter comparisons into a function so we don't have to repeat code for arrays and non-arrays. Other than that, I don't think there's much else we can do.

If I think of anything, I'll let you know

from cobalt.

qasim avatar qasim commented on June 15, 2024

The goal is to house all the things we do in each filter file and abstract it. It will be similar to how an actual language interprets syntax.

from cobalt.

qasim avatar qasim commented on June 15, 2024

Happening at cobalt/filter-revamp.

from cobalt.

qasim avatar qasim commented on June 15, 2024

cobalt/filter-revamp/src/api/utils/query-parser/index.js

from cobalt.

qasim avatar qasim commented on June 15, 2024

Here's what I've got as for a preliminary filter endpoint function under the new QueryParser model:
https://github.com/cobalt-uoft/cobalt/blob/filter-revamp/src/api/buildings/routes/filter.js

On average, filter requests in the new model fair slightly faster than the current stable release (0.4.3), tested using Nodejs 6.0 for both (~100ms difference testing 100 sequential requests, averaged over 10 attempts). Not so significant, but it's good to know its not slower.

I still haven't addressed things that require MapReduce. I'm looking into using MongoDB's new aggregate functions and whether they are speedier. Will report back as soon as I get something conclusive.

from cobalt.

qasim avatar qasim commented on June 15, 2024

QueryParser
https://github.com/cobalt-uoft/cobalt/blob/filter-revamp/src/api/utils/query-parser/index.js

courses/filter
https://github.com/cobalt-uoft/cobalt/blob/filter-revamp/src/api/courses/routes/filter.js
https://github.com/cobalt-uoft/cobalt/blob/filter-revamp/src/api/courses/routes/filterMapReduce.js

@kshvmdn this is what query parsing + a mapreduce looks like under new model. What do you think? I'm exhausted from looking at this so please help me dig around and see if we can simplify this at all ._.

from cobalt.

qasim avatar qasim commented on June 15, 2024

I've also added throwing appropriate errors, better to tell the user something went wrong I'd think.

from cobalt.

Related Issues (20)

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.