package com.mongo;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection = "students")
public class Student {
    @Id
    private String id;
    private String name;

    @Indexed 
    private String studentId;

    public Student(String name, String studentId) {
        this.name = name;
        this.studentId = studentId;
    }
    
   
    public String getStudentId() { return studentId; }

    @Override
    public String toString() {
        return "Student{name='" + name + "', studentId='" + studentId + "'}";
    }
}