# OrderedMap

The **OrderedMap** object is an [associative container](http://en.wikipedia.org/wiki/Associative_container) and is identical to the [**Map**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/map) object except for the ordering of items within the map.

Whereas the regular **Map** object sorts items alphabetically by key, the **OrderedMap** preserves the order that items are added.

You can create a new **OrderedMap** using the [**DOpusFactory**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/dopusfactory)**.OrderedMap** method. All Opus script methods documented as accepting a **Map** object can also accept an **OrderedMap**.

See the documentation of the [**Map**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/map) object for more information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/orderedmap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
