Programming notes

about java, spring, android, app performance and architecture

Sunday, 29 March 2020

Spring Data and MongoDb aggregation examples

I've faced recently with some not trivial mongo aggregation queries and found there are not so many examples available, so main source is official docs https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#introduction

also was useful tests of the Spring Framework:

https://github.com/spring-projects/spring-data-mongodb/blob/master/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java

https://github.com/spring-projects/spring-data-mongodb/blob/master/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java

use to profile query
db.events.explain("executionStats").aggregate("query") 
Posted by Sergey at 16:43 0 comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: mongodb, spring, springdata
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Search This Blog

About Me

Sergey
View my complete profile
View Sergey Safonov's profile on LinkedIn

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Labels

  • java (25)
  • libraries (19)
  • performance (17)
  • android (15)
  • spring (14)
  • other (13)
  • database (8)
  • javaee (7)
  • hibernate (6)
  • tomcat (6)
  • architecture (5)
  • javascript (4)
  • books (3)
  • api (2)
  • concurrency (2)

Blog Archive

  • ►  2022 (1)
    • ►  December (1)
  • ▼  2020 (5)
    • ►  September (1)
    • ►  June (1)
    • ►  April (2)
    • ▼  March (1)
      • Spring Data and MongoDb aggregation examples
  • ►  2019 (4)
    • ►  October (3)
    • ►  March (1)
  • ►  2018 (3)
    • ►  August (1)
    • ►  June (1)
    • ►  March (1)
  • ►  2017 (11)
    • ►  September (1)
    • ►  July (1)
    • ►  June (3)
    • ►  March (2)
    • ►  February (3)
    • ►  January (1)
  • ►  2016 (12)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (4)
    • ►  August (1)
    • ►  June (1)
    • ►  May (1)
    • ►  February (2)
  • ►  2015 (9)
    • ►  December (1)
    • ►  November (2)
    • ►  October (1)
    • ►  May (1)
    • ►  March (2)
    • ►  January (2)
  • ►  2014 (5)
    • ►  November (1)
    • ►  October (2)
    • ►  May (1)
    • ►  January (1)
  • ►  2013 (11)
    • ►  December (1)
    • ►  October (2)
    • ►  July (2)
    • ►  June (2)
    • ►  April (2)
    • ►  March (1)
    • ►  January (1)
  • ►  2012 (14)
    • ►  December (1)
    • ►  November (2)
    • ►  September (1)
    • ►  August (2)
    • ►  July (2)
    • ►  June (2)
    • ►  April (1)
    • ►  March (1)
    • ►  February (2)
  • ►  2011 (17)
    • ►  December (1)
    • ►  November (1)
    • ►  September (4)
    • ►  August (1)
    • ►  July (1)
    • ►  May (2)
    • ►  April (2)
    • ►  March (1)
    • ►  February (1)
    • ►  January (3)
  • ►  2010 (18)
    • ►  December (6)
    • ►  November (2)
    • ►  October (7)
    • ►  September (3)

Geography

30 days page views

Popular Posts

  • A different object with the same identifier value was already associated with the session
    Hibernate Error: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the ...
  • Free Java hosting options and Heroku tomcat deployment
    I wanted to write some java app that would communicate with 3rd party API. The main problem there was that this API requires https connecti...
  • Horizontal scrollbars at top & bottom in Datatables
    In my data table I have a lot of data so horizontal scroll is required. I found library jQuery-doubleScroll but it doesn't work with D...
  • Android: Context menu in ListView after clicking
      The easiest way) to create context menu
  • Spring Boot 2 and custom JsonSerializer
    I was migrating recently to the new Spring Boot version 2. And most annoying thing was that PageImpl (component used for pagination)  chan...
  • Android:The easiest way to load image from URL
    The easiest way to download image from URL is to use method Drawable.createFromStream : main.xml: <linearlayout android:id="@+id...
  • Approximate string matching algorithm (fuzzy search)
    This is a great algorithm to find similarity coefficient of the two words. Author is Viterbi or Bellman.I didn't find anything about ...
  • Tsung: Web Application Performance and Stress Testing
    The purpose of Tsung is to simulate users in order to test the scalability and performance of IP based client/server applications. You ...
  • Auto Generate Database(ER) Diagram MySql
    To create ER diagram from db schema you can use SchemaSpy.
  • Migrating a project from Java 11 to Java 17
    Java 17 is new LTS version and it make sense to migrate existing projects to the new version. I will describe my specific case
Awesome Inc. theme. Powered by Blogger.