Questions tagged [nosql-aggregation]

Questions related to Aggregation functions in NoSQL databases.

Questions related to Aggregation functions such as Count() or Sum() in NoSQL databases.

313 questions
0
votes
1 answer

MongoDB aggregation result difference

I'm trying to compose a query to find all documents in a collection with the 'date' < current date, flag = true, sort by date (descending) and limit the result to (e.g.) 10 documents, then select all the remaining documents (satisfying the date and…
asliwinski
  • 1,662
  • 3
  • 21
  • 38
0
votes
1 answer

MongoDb - How to only return field of nested subdocument when using lookup aggregation?

I'm very new to MongoDb so I'm used to SQL. Right now I have two collections in my database: 1) Series (which has nested subdocuments) 2) Review (decided to reference to episode subdocument because there will be a lot of reviews) See this picture…
0
votes
1 answer

Firebase Joining, Grouping, Aggregation Equivalent in SQL

I am coming from SQL and trying Firebase for the fist time. Is this query possible with Firebase? SELECT name, AVG(rating) as avgRating FROM restaurants JOIN reviews ON restaurants.ID = reviews.restaurantsID GROUP BY restaurants.ID ORDER…
0
votes
0 answers

MongoDB queries on embedded documents within arrays not returning results

I'm having a problem querying a dataset called Geolytix Supermarkets January 2015 update The problem is that the queries I've run either return all results or no results at all. This is a snapshot of the…
SJ Lovatt
  • 11
  • 4
0
votes
1 answer

query performance while filtering embedding large arrays documents Mongodb

In my mongodb collection i have 15 million documents with following json structure. The embedded document count inside playfields array field changes for each json document. All my queries involves filtering the documents based on data in playfields…
user1745679
  • 209
  • 1
  • 2
  • 9
0
votes
1 answer

Perform Aggregation/Set intersection on MongoDB

I have a query, consider the following example as a intermediate data after performing some aggregation on a sample dataset; fileid field contains the id of a file, and the user array containing array of users, who made some changes to the…
0
votes
1 answer

Couchbase - best practice for storing huge listts

Is Couchbase capable of storing multiple lists, each holds between 100,000-100,000,000 records? The records are stored in a "data series" fashion (or delayed queue) and queried accordingly. Example List dataset structure: id list_id # the list the…
eldad87
  • 195
  • 1
  • 13
0
votes
2 answers

Mongodb Schema for Posts and Shares

I am new to mongodb NoSQL concept and stuck at point where I am unable to take a decision for modelling the schema that could best serve my purpose. I need to design schema in such a way that I have my end result as Posts and Shares sorted by time.…
0
votes
1 answer

Group By Count on Array MongoDB

This is one out of ~10 million rows in my database: { "_id" : ObjectId("58f569159f809c49ffc5cdbb"), "date" : ISODate("2017-03-21T09:10:07.686Z"), "p1" : { "_id" : 1765906, "deck" : [ 33, 25, …
kentor
  • 16,553
  • 20
  • 86
  • 144
0
votes
1 answer

How to multiply the count of each document by a value in it?

Suppose I have many documents like this: { "foo": "Something", "bars": [ { "identifier": 1, "content": "meh", "quantity": 2 }, { "identifier": 2, …
Luiz
  • 2,429
  • 8
  • 28
  • 43
0
votes
3 answers

How to match and group in multiple cases in mongodb aggregation?

i have 4 players with there scores in different matches. e.g {user: score} -- json keys {'a': 10}, {'a':12}, {'b':16} I am trying to find out a way in which i can found sum of single player using aggregation…
Prashant Tapase
  • 2,132
  • 2
  • 25
  • 34
0
votes
1 answer

Getting all the related doc and aggregate data from selected doc in single n1ql query

I have just started with couchbase and i have following requirement I have following docs: referral doc { "_id": "8c658e34-34cc-4e61-8b26-5abc1cebd95e", "_metadata": { "created_at": 1472550145662, "created_by": "api-tenant-1" }, …
0
votes
1 answer

Aggregate the total sum of aggregation field

Hi all, I'm trying with no luck so far, to aggregate the total impressions sum of impressions field, but I keep getting an error. I got the following query: GET smarttag-2016.06.28.*/_search?search_type=count { "query": { "bool": { …
0
votes
1 answer

selective find in mongoose

USER SCHEMA: { friends: [{ user_id: {type: mongoose.Schema.Types.ObjectId, required: true, ref: 'User'}, name: {type: String, required :true}, age: {type: Number, required: true} }], privacy_settings : { …
Nikhil
  • 467
  • 10
  • 22
0
votes
2 answers

Google Cloud DataStore. How to serve data?

Like many, I'm no new the NoSQL world. I did a lot of research, but I still lack only one point, which I can't find proper answer for. Short description of system: I'm building a system that collects Visitor's data on different websites. Each visit…