JavaThinking.com
Toggle Menu
Home
Online Kotlin Compiler
Tutorials
Spring Boot
Spring Cloud
Spring Data
Spring MVC
Spring Security
Blog
All Posts
Spring Data MongoDB
Review your knowledge of working with NoSQL databases in the Spring ecosystem.
1. Which Spring Data MongoDB interface provides basic CRUD operations and query methods out of the box?
MongoRepository
CrudRepository
PagingAndSortingRepository
JpaRepository
2. Which of the following are valid query derivation keywords in Spring Data MongoDB method names?
findBy
updateBy
countBy
deleteBy
3. The @Id annotation in Spring Data MongoDB can only be applied to fields of type String.
True
False
4. What is the name of the central class in Spring Data MongoDB used for interacting with MongoDB directly, similar to JdbcTemplate?
5. What is the purpose of the @Field annotation in Spring Data MongoDB?
To specify the MongoDB field name
To mark a field as the primary key
To exclude a field from persistence
To define an index
6. Which of the following methods are provided by the MongoRepository interface by default?
save()
findById()
deleteAll()
update()
7. The @Query annotation in Spring Data MongoDB can be used to define custom JPQL queries.
True
False
8. What is the name of the class in Spring Data MongoDB that is used to build aggregation pipelines?
9. Which annotation is used in Spring Data MongoDB to define an index on a field?
@Indexed
@Index
@MongoIndex
@DbIndex
10. What is the name of the reactive counterpart to MongoRepository in Spring Data MongoDB?
Reset
Answered 0 of 0 — 0 correct