# Replace

Replace the entire document with a new one. When you want to update the document, and you don't know which part will be updated each time, you can update that document by replacing it entirely.

{% openapi src="<https://760328771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LwSkuCpTNI_AerL8J2a%2Fuploads%2FCpzJktmKXD6FMPSah1nK%2Fopenapi.json?alt=media&token=854cdd6a-61b2-49a5-99f4-6bc091e5c3d6>" path="/{version}/db/{CollectionName}/replaceOne" method="put" expanded="true" %}
[openapi.json](https://760328771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LwSkuCpTNI_AerL8J2a%2Fuploads%2FCpzJktmKXD6FMPSah1nK%2Fopenapi.json?alt=media\&token=854cdd6a-61b2-49a5-99f4-6bc091e5c3d6)
{% endopenapi %}
