'How to add multiple object ID to mongodb using vue.js

This is code that I still working on, I intend to make auto increment which user can choose how many bulk/multiple serial number that he/she want to send. for example 1 serialNumber=123 if user choose 3 multiple value it will be 124,125,126 it will auto increment by +1.

                          <v-form ref="form" v-model="valid">
                            <v-select
                              :items="customerId"
                              item-value="customerId"
                              :item-text="
                                (customerId) => {
                                  return (
                                    customerId.customerId +
                                    ' - ' +
                                    customerId.customerName
                                  );
                                }
                              "
                              v-model="serialNumberData.customerId"
                              label="Customer ID*"
                              :rules="[(v) => !!v || 'Customer ID is required']"
                            >
                            </v-select>
                            <v-select
                              v-model="serialNumberData.deviceType"
                              :items="deviceType"
                              item-value="deviceType"
                              :item-text="
                                (deviceType) => {
                                  return (
                                    deviceType.deviceType +
                                    ' - ' +
                                    deviceType.deviceName
                                  );
                                }
                              "
                              label="Device Type*"
                              :rules="[(v) => !!v || 'Device type is required']"
                            >
                            </v-select>
                            <v-select
                              :items="connectivityType"
                              v-model="serialNumberData.connectivityType"
                              label="Connectivity Type*"
                              :rules="[
                                (v) => !!v || 'Connectivity type is required',
                              ]"
                            >
                            </v-select>
                            <v-text-field
                              label="Device ID*"
                              type="number"
                              v-model="serialNumberData.serialNumber"
                              :rules="serialNumberRules"
                              :counter="5"
                            ></v-text-field>
                            <v-text-field
                              label="IMEI number/Mac address*"
                              v-model="serialNumberData.connectivityNumber"
                              :rules="imeiNumberRules"
                            ></v-text-field>
                          </v-form>
                       

For now what I have is can send a single value, what I need is send a multiple value, let's say if I want to add another 2 serial number with the following running number it will auto generating number is 00002 and 000003 which is a new object ID in mongodb



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source