KeplerGrid guide

Edit a nested MongoDB field and preserve its BSON type

Update a nested price through the document inspector, then review the changed path before committing. Use $numberDecimal in Extended JSON to keep the value as BSON Decimal128.

Load the complete practice document

Use the synthetic inventory on a development MongoDB instance. For this exercise, connect in Read & write mode using an account allowed to update that collection.

Open keplergrid_inventory.inventory in Documents. Run the filter below. Leave Projection empty so the result contains the complete document.

{ "_id": "SKU-100" }

Stage a Decimal128 price change

Select the returned notebook. If needed, open the pane with Toggle document inspector in the toolbar. In Document inspector, choose Extended JSON. Find pricing.unitPrice, currently { "$numberDecimal": "12.50" }.

Replace that value inside the existing document with this Extended JSON value. Leave _id, currency, and the rest of the document as they are.

{ "$numberDecimal": "12.75" }

Click Stage document changes. The new price is a local draft at this point.

Review the changed path before committing

Click Review & commit. In Review changes, verify the development connection, collection, and SKU-100. The diff should show only pricing.unitPrice changing from 12.50 to 12.75, with Decimal128 on both sides.

Keep only the intended document selected and click Commit 1 document. If the review shows a conflict, use Resolve with latest… to inspect the current document before deciding whether to apply the edit.

Run a fresh query and verify the stored value

Run the original filter again, select SKU-100, and reopen the inspector’s Extended JSON tab. Verify that pricing.unitPrice now reads { "$numberDecimal": "12.75" }. The wrapper identifies a BSON Decimal128 in the freshly read document.

See how projection changes the returned fields if the document opens without editing controls.

Next, Update a MongoDB counter atomically with $inc.

Rename or remove a MongoDB field across documents