Commit 2394afc8 authored by ppapili's avatar ppapili

Added Unique Key for employee

parent 952a69e5
package com.poc.kafka.mongo.entity;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
......@@ -9,6 +10,7 @@ public class Employee {
@Id
private String _id;
@Field(name = "emp_id")
@Indexed(unique=true)
private Long empId;
@Field(name = "emp_name")
private String empName;
......
......@@ -22,5 +22,6 @@ spring.data.mongodb.database=ownDatabase
server.servlet.context-path=/kafka-mongo-poc
logging.level.org.springframework.data.mongodb.core.MongoTemplate=DEBUG
spring.data.mongodb.auto-index-creation=true
logging.level.org.springframework=INFO
logging.level.root=INFO
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment