I have searched for how to create a unique index, but I haven't seen any guides doing it. I want to put a unique key on three variables in my document. x, y, and z. I'm storing coordinates, and need to make sure I can't have duplicate x, y, and z coords. Anything helps.
Edit: I'm trying to this SQL in MongoDB:
CREATE TABLE mapPosition(
x INT NOT NULL,
y INT NOT NULL,
z INT NOT NULL
CONSTRAINT mapPosition_x_y_z_pk PRIMARY KEY (x, y, z)
);