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: Posts (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 ...
  • 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...
  • 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
  • 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...
  • Generate settings-security.xml file for maven password encryption
      mvn --encrypt-master-password   does not create a file   security-settings.xml .  Use the command  mvn --encrypt-master-password  to gener...
  • Auto Generate Database(ER) Diagram MySql
    To create ER diagram from db schema you can use SchemaSpy.
  • JavaEE : Hibernate tutorial
    Hibernate is an object-relational mapping (ORM) library for the Java language, providing a framework for mapping an object-oriented domain ...
  • Domain Driven Design in Java
    I think most enterprise java world is suffering  from  Anemic Domain Model . One of the ways that can help you is DDD. I've started res...
  • End-to-end tests with Spring and Test Containers
    I've heard previously about test-containers  but didn't have chance to read about it. Testcontainers is a Java library that support...
  • 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 ...
Awesome Inc. theme. Powered by Blogger.