druv5319/Sneaks-API

Converting to an integrated/embedded database

Opened this issue · 6 comments

Having a database within this API makes it so searched sneakers including their links to each of the resell sites are cached. Because of this, when searching for product prices, the API is instantly able to grab prices with the product links already cached from previous searches. Currently, this API is dependant on MongoDB and requires users to install MongoDB and have its process running. I'm looking for a way so users don't have to install and run MongoDB, any contributions are greatly appreciated, thanks!

I think nedb would be well suited for this. I need to figure out where you're using the database in the current code though.

It’s used only within the getProducts function and getProductPrices function within the controller file where the Sneaks class is located.

I am also using a mongoose schema for the Sneaker object so I’m not sure if nedb will be compatible with it.

Maybe the camo library could help transition it over from mongoDB to nedb? Allows use of a schema.

I'm dying here bc mongoDB is acting up for me lol...get some strange errors running it on my Mac