Insert value in mongo DB with datatype specify Robomongo UI

244 views Asked by At
db.employee_details.insert(
on_boarding_id : NumberLong(1),
user_name : String('chandan kumar'),
gender : Timestamp(),
blood_group : String('o+'),
marital_status : String('single'),
pan_no : String('CDSNJHJ8789'),
emergency_contact : Number(98989898989),
mobile_number : Number(9205972503),
hdfc_salary_account_details : Boolean(true),
hdfc_account : String('HJHGHHJ3222423'),
address : [
            {
                current : [{
                    address : String('New Nagar Deepatoli'),
                    pin_code : Number(909990),
                    city : String('ranchi'),
                    state : String('jharkhand')
                }]
            },
             {
                 parament : [{
                    address : String('Gurgaon iffco chowk'),
                    pin_code : Number(894893),
                    city : String('gurgaon'),
                    state : String('haryna') 
                 }]
             }
           ],
adhaar_no : String('4567HJFGKJGH98')
)

Hi I want to store this data through robomongo UI in mongoDB but it produce error please help me to fix this issue .. thanks for your support.

1

There are 1 answers

0
n32303 On BEST ANSWER

You forgot to add curly brackets inside insert function.

db.employee_details.insert({
    on_boarding_id: NumberLong(1),
    user_name: String('chandan kumar'),
    gender: Timestamp(),
    blood_group: String('o+'),
    marital_status: String('single'),
    pan_no: String('CDSNJHJ8789'),
    emergency_contact: Number(98989898989),
    mobile_number: Number(9205972503),
    hdfc_salary_account_details: Boolean(true),
    hdfc_account: String('HJHGHHJ3222423'),
    address: [{
            current: [{
                address: String('New Nagar Deepatoli'),
                pin_code: Number(909990),
                city: String('ranchi'),
                state: String('jharkhand')
            }]
        },
        {
            parament: [{
                address: String('Gurgaon iffco chowk'),
                pin_code: Number(894893),
                city: String('gurgaon'),
                state: String('haryna')
            }]
        }
    ],
    adhaar_no: String('4567HJFGKJGH98') 
})