Skip to content

Tag: mongodb

Is such a result possible with a query from an SQL database?

I want to fire a query to get such a result: Tables Schema I guess it’s not possible like that? I don’t have any experience with text-based databases, but I can well imagine that this can be achieved with a MongoDB. Because ultimately I want to have a js object at the end of the day. Answer Here’s an example

Perform Calculation in MongoDb Query

Supposed I have the collections that contain Event type Product View water_heater View water_heater Purchase water_heater View television View television View television Purchase television There are two types of fields in the first column, (views and purchase) The second column contains different kinds of products. The above data has been imported as a collection in MongoDB database. I want to

Mongodb for projects with many to many relationships

I’m at the beginning of starting a project for learning backend development with a bit of frontend development. For that, I wanted to create a project around cooking recipes. The plan was to create an admin REST API that would be later used by a custom CMS to create, edit, delete,… recipes and a public api for a mobile app

Mongo Group By query

I have data stored in a Mongo collection that is structured like this: I wish to construct a query that would let me sum up each count in each entry and group by requestingSupplier. For example, I would like to answer the question, for the month of January ’22, what was the sum of each entity and get a response

How do I convert this to mongodb aggregate query?

SELECT prop_type , count(prop_type) As no_of_properties from prop_type JOIN prop_for_rent USING (prop_type) GROUP BY prop_type; prop_type and prop_for_rent are both tables. Then “prop_type” used for the JOIN and GROUP BY is an attribute name in both. The expected result is for the query to count the number of properties in each property type. And this is the result of the

Search Algorithm Implementation using NodeJS + MongoDB(or SQL)

There is an application with search input that gives an opportunity to search for contacts by their information stored in database. For example, I can type 0972133122 Alan and my search engine must return all contacts whose firstname is Alan & whose numbers match 0972133122 string. Of course, I can just type Alan 0972, for instance, and there must be

NoSQL or SQL for Data Structure [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I’m building an app, and this is my first time working with databases. I went with MongoDB because originally I