There are three tables in my database: "parent", "children", and "grandchildren". These tables have many-to-many relationships. In addition to the main tables, there are also two relational tables. I want to create a query that will return all parent elem ...
I need to be able to use $regex in order to search for any words that contain a specific keyword provided by the user, but I'm experiencing issues. Here's what I have so far: aggregatePipeline.push({ $match: { name: { $reg ...
Consider the scenario with these sample documents: (parent_id: null denotes items located at root directory) {"_id":"a", "name":"Pictures", "parent_id": null, "type": "folder"} {"_ ...
In my dataset, there is survey data along with columns containing demographic information such as age and department, as well as ratings. I want to enhance the dataset by adding new columns based on calculations from the existing rating columns. The goal ...
Error in $project :: caused by :: Unrecognized expression '$$varientPricePoint.ppId' { "pricepoint": { "$filter": { "input": "$OriginalPricePoints", "as": "varien ...
I need to create an array_C that includes only the elements from array_A that are not present in array_B. My approach involves using $match in aggregate to specify array_B. For instance: array_A = [1, 2, 3] array_B = [2, 4, 6, 8, 10] array_C = [1, 3] I a ...
Showing my dataset: df = [{'id': 1, 'name': 'bob', 'apple': 45, 'grape': 10, 'rate':0}, {'id': 1, 'name': 'bob', 'apple': 45, 'grape': 20, ...
Could someone help me troubleshoot my aggregate query? I'm trying to sum the count values for each beacon, but it keeps returning 0. Please let me know if you spot any mistakes in the query. Sample Data [ { ...
I have collected data on births that is structured like so: Date Country Sex 1.1.20 USA M 1.1.20 USA M 1.1.20 Italy F 1.1.20 England M 2.1.20 Italy F 2.1.20 Italy M 3.1.20 USA F 3.1.20 USA F My goal is to transfor ...
Currently, I am utilizing PostgreSQL 9.5 and have a table containing JSON arrays with JSON objects structured like so: [] [{animal:cat}, {plant:sunflower}, {car:mercedes}] [{animal:dog}] [{animal:dog}, {car:audi}] [] The goal is to present a table that m ...