# Mongo DB insertOne Error

**URL:** https://community.neutrinos.com/t/mongo-db-insertone-error/1194
**Category:** Support Request
**Tags:** neutrinos-ssd
**Created:** [September 3, 2025, 11:21am UTC](https://community.neutrinos.com/t/mongo-db-insertone-error/1194 "2025-09-03T11:21:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![JeevanKumar](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@JeevanKumar](https://community.neutrinos.com/u/JeevanKumar)
#### Post date: [September 3, 2025, 11:21am UTC](https://community.neutrinos.com/t/mongo-db-insertone-error/1194/1 "2025-09-03T11:21:40Z")

</div>

I am inserting a local data to database

```auto
bh.local.bookData = {
    isbn: 'OL7353617M',
    title: 'Fantastic Mr. Fox',
    author: 'Roald Dahl',
    publishedYear: 1988
  },

```

 ![Screenshot 2025-09-03 at 4.49.23 PM](https://community.neutrinos.com/uploads/default/original/1X/525858c915ab491aab3e8cd3a197c9815963d932.png)

got this error

```auto
TypeError: Reflect.get called on non-object
    at Reflect.get (<anonymous>)
    at Collection.insertOne (/Users/jeevan/neutrinos-studio/jk-book-management-backend/server/node_modules/mongodb/lib/collection.js:147:32)
    at MongoPersistance.insertOne (file:///Users/jeevan/neutrinos-studio/jk-book-management-backend/server/src/utils/ndefault-mongodb/Mongodb/MongoPersistance.ts:86:46)
    at books.insertbook (file:///Users/jeevan/neutrinos-studio/jk-book-management-backend/server/src/sd-services/books.ts:329:75)
    at books.dfsdfd (file:///Users/jeevan/neutrinos-studio/jk-book-management-backend/server/src/sd-services/books.ts:318:29)
    at books.ifInvalidIsbn (file:///Users/jeevan/neutrinos-studio/jk-book-management-backend/server/src/sd-services/books.ts:298:33)
    at books.validateIsbn (file:///Users/jeevan/neutrinos-studio/jk-book-management-backend/server/src/sd-services/books.ts:286:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///Users/jeevan/neutrinos-studio/jk-book-management-backend/server/src/sd-services/books.ts:89:22

```

the same thing works properly in insertMany (after inserting bookData into a Array) but insertOne gives this error

---

<div class="post-metadata">

### Author: ![Sam](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Sam](https://community.neutrinos.com/u/Sam)
#### Post date: [September 3, 2025, 12:17pm UTC](https://community.neutrinos.com/t/mongo-db-insertone-error/1194/2 "2025-09-03T12:17:25Z")

</div>

Hello @JeevanKumar ,Ensure that the database is initialized properly, the collections are correct, and the fields are properly defined.

---

<div class="post-metadata">

### Author: ![JeevanKumar](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@JeevanKumar](https://community.neutrinos.com/u/JeevanKumar)
#### Post date: [September 3, 2025, 12:47pm UTC](https://community.neutrinos.com/t/mongo-db-insertone-error/1194/3 "2025-09-03T12:47:49Z")

</div>

@Sam

database initialised properly because it works for other operations like insertMany and find.

---

<div class="post-metadata">

### Author: ![Shamnad\_KS](https://community.neutrinos.com/user_avatar/community.neutrinos.com/shamnad_ks/32/272_2.png) [@Shamnad\_KS](https://community.neutrinos.com/u/Shamnad_KS)
#### Post date: [September 4, 2025, 6:33am UTC](https://community.neutrinos.com/t/mongo-db-insertone-error/1194/4 "2025-09-04T06:33:52Z")

</div>

Hi @JeevanKumar  
Thanks for sharing the details and the screenshot 🙌

The issue here is with the **Options** field in your `insertOne` config. For `insertOne`, options are meant only for things like `session`, `writeConcern`, etc. — but right now you have it mapped to `bh.input.body.isbn`, which makes MongoDB treat it as the options object and throws the `Reflect.get` error.

Can you please try removing the **Options** mapping (leave it blank), and just keep:

- **Collection** → `books`
- **Operation** → `insertOne`
- **Document** → `bh.local.bookData`
- **Result Mapping** → `bh.local.response.body`

That should fix the error. Give it a try and let us know if it works

---

<div class="post-metadata">

### Author: ![JeevanKumar](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@JeevanKumar](https://community.neutrinos.com/u/JeevanKumar)
#### Post date: [September 4, 2025, 7:35am UTC](https://community.neutrinos.com/t/mongo-db-insertone-error/1194/5 "2025-09-04T07:35:08Z")

</div>

Thank you @Shamnad_KS  
the option was the problem.

but we can’t keep the option blank . it shows required .

 ![Screenshot 2025-09-04 at 1.00.44 PM](https://community.neutrinos.com/uploads/default/original/1X/24c54b9d83f6971d1d64a85fe1e9eb9b704dbd23.png)

it worked when I put a null value like this

 ![Screenshot 2025-09-04 at 1.04.50 PM](https://community.neutrinos.com/uploads/default/original/1X/4bfc7fb8d12025240170ededbca5aac8ea428dcf.png)
