api-1              | Incoming asset data: {
api-1              |   vendor: 'anki',
api-1              |   applicationName: 'omada',    
api-1              |   qty: 123,                    
api-1              |   used: 23,                    
api-1              |   remaining: 100,              
api-1              |   startDate: '2025-03-13',     
api-1              |   endDate: '2025-03-21',
api-1              |   renewalCost: 1235,           
api-1              |   contactPerson: 'anku',       
api-1              |   emailId: 'anku@gmail.com',   
api-1              |   contactNumber: '7206699280', 
api-1              |   assetId: '1743055458925'     
api-1              | }                              
api-1              | Error creating asset: E11000 duplicate key error collection: DataStore.assets index: serialNumber_1 dup key: { serialNumber: null }    
mongodb-container  | {"t":{"$date":"2025-03-27T06:04:30.797+00:00"},"s":"I",  "c":"WTCHKPT",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":{"ts_sec":1743055470,"ts_usec":797055,"thread":"1:0x7f1459c656c0","session_name":"WT_SESSION.checkpoint","category":"WT_VERB_CHECKPOINT_PROGRESS","category_id":7,"verbose_level":"DEBUG_1","verbose_level_id":1,"msg":"saving checkpoint snapshot min: 5, snapshot max: 5 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 2332"}}}
mongodb-container  | {"t":{"$date":"2025-03-27T06:05:30.831+00:00"},"s":"I",  "c":"WTCHKPT",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":{"ts_sec":1743055530,"ts_usec":830892,"thread":"1:0x7f1459c656c0","session_name":"WT_SESSION.checkpoint","category":"WT_VERB_CHECKPOINT_PROGRESS","category_id":7,"verbose_level":"DEBUG_1","verbose_level_id":1,"msg":"saving checkpoint snapshot min: 8, snapshot max: 8 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 2332"}}}   gtting this when i m adding a new asset 

inject-aws.js:11 
            
            
            POST http://localhost:3000/api/assets 500 (Internal Server Error)
window.fetch @ inject-aws.js:11
handleSubmit @ AddNewAsset.jsx:57
callCallback2 @ react-dom.development.js:4164
invokeGuardedCallbackDev @ react-dom.development.js:4213
invokeGuardedCallback @ react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291
executeDispatch @ react-dom.development.js:9041
processDispatchQueueItemsInOrder @ react-dom.development.js:9073
processDispatchQueue @ react-dom.development.js:9086
dispatchEventsForPlugins @ react-dom.development.js:9097
(anonymous) @ react-dom.development.js:9288
batchedUpdates$1 @ react-dom.development.js:26179
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchDiscreteEvent @ react-dom.development.js:6430
AddNewAsset.jsx:67  Error response from server: {message: 'Server error', error: 'E11000 duplicate key error collection: DataStore.a…x: serialNumber_1 dup key: { serialNumber: null }'}
handleSubmit @ AddNewAsset.jsx:67
await in handleSubmit
callCallback2 @ react-dom.development.js:4164
invokeGuardedCallbackDev @ react-dom.development.js:4213
invokeGuardedCallback @ react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291
executeDispatch @ react-dom.development.js:9041
processDispatchQueueItemsInOrder @ react-dom.development.js:9073
processDispatchQueue @ react-dom.development.js:9086
dispatchEventsForPlugins @ react-dom.development.js:9097
(anonymous) @ react-dom.development.js:9288
batchedUpdates$1 @ react-dom.development.js:26179
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchDiscreteEvent @ react-dom.development.js:6430
AddNewAsset.jsx:89  Error saving asset: Error: Failed to save asset
    at handleSubmit (AddNewAsset.jsx:68:23          i dont know whwre the datasbse is made becoause in my compass i dont get any of the detials liek goin signup detisl const express = require("express");
const mongoose = require("mongoose");
const cors = require("cors");
const cookieParser = require("cookie-parser");

const app = express();
const assetRoutes = require("./routes/assetRoutes");
const authRoute = require("./routes/auth");
// const MaintenanceRoutes = require("./routes/MaintenanceRoutes");
const adminRoutes = require("./routes/AdminUsers");
const assignmentRoutes = require('./routes/assignmentRoutes');
const employee=require('./routes/employee');
const AdminUser = require('./models/AdminUser');


const Assignment = require('./models/Assignment');


app.use(express.json());
app.use(cookieParser());

app.use(
  cors({
    origin: "http://localhost:3000",
  })
);

app.use("/", assetRoutes);
app.use("/", authRoute);
// app.use('/api/maintenance', MaintenanceRoutes);// Ensure this route is used
app.use("/", adminRoutes);
app.use('/assignments', assignmentRoutes);
app.use('/',employee);


app.post('/users', async (req, res) => {
    try {
      console.log(req.body)
        const newUser = new AdminUser(req.body);
        await newUser.save();
        res.status(201).json(newUser);
    } catch (error) {
        console.error(error);
        res.status(500).json({ error: 'Server error' });
    }
});



app.post('/assignments', async (req, res) => {
    const { userId, assetId, assignmentDate, status } = req.body;
    try {
        const newAssignment = new Assignment({ userId, assetId, assignmentDate, status });
        await newAssignment.save();
        res.status(201).json(newAssignment);
    } catch (error) {
        res.status(400).json({ message: error.message });
    }
});


const PORT = 5001;
app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});

const MONGODB_URI = process.env.MONGODB_URI || "mongodb://localhost:27017/DataStore";
mongoose.connect(MONGODB_URI);

const database = mongoose.connection;

database.on("error", (error) => {
  console.log(error);
});

database.once("connected", () => {
  console.log("Database Connected");
});
     i only replaced the Uri with this but in y mongodb i cant find this conenection