Skip to content

Instantly share code, notes, and snippets.

@prafful98
Created Jan 16, 2022
Embed
What would you like to do?
package com.example.api.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
@Document("users")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class User {
@Id
private String userName;
private String firstName;
private String lastName;
@Indexed(unique = true)
private String email;
private String password;
private String role;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment