On Wed, 10 Feb 2021 00:05:58 GMT, Rey Valeza wrote:

How do I use the MongoDB _id field in a form?

I have this struct:

struct Employee
{

string _id;
string deprt;
string email;
string pword;
string fname;
string lname;
string phone;
string paygd;
string photo;
string street;
string city;
string province;
string postcode;

}

The question is: what data type should the _Id be?

When I submit the form, I get this error:

BSON value is type 'objectID', expected to be one of [string, code, symbol]

I got the answer: BsonObjectID. Now my problem this error: BsonObjectID should be 24 cahracters long.