# Как добавить \_default\_ \_timestamp при создании индекса на node js

**URL:** <https://discuss.elastic.co/t/-default---timestamp-node-js/72489>\
**Category:** Вопросы на русском языке\
**Created:** [January 23, 2017, 2:04pm UTC](https://discuss.elastic.co/t/-default---timestamp-node-js/72489 "2017-01-23T14:04:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![whispersofdew](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whispersofdew/32/11067_2.png) [@whispersofdew](https://discuss.elastic.co/u/whispersofdew)\
**Post date:** [January 23, 2017, 2:04pm UTC](https://discuss.elastic.co/t/-default---timestamp-node-js/72489/1 "2017-01-23T14:04:17Z")

</div>

Доброго времени суток. Очередной вопрос по API node js(

Данная команда прекрасно отрабатывает если я делаю создание индекса через консоль или сенс.

Но через nodejs добавляет просто пустой мапинг.

Я пробывал и вне бади маппинг подставлять, и внутри. Результат - создается индекс с пустым мэпингом.  
Версия 2.3.3

```
elasticClient.indices.create({
    index: "tst11",
    body: {
        mapping : {
            _default_:{
                _timestamp : {
                    enabled : true,
                }
            }
        },
    }
}, function (err, resp, respcode) {
    console.log(err, resp, respcode);
});

```

Результат

```
{
  "tst11": {
    "mappings": {}
  }
}
```

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [January 23, 2017, 3:36pm UTC](https://discuss.elastic.co/t/-default---timestamp-node-js/72489/2 "2017-01-23T15:36:50Z")

</div>

`mapping` → `mappings`?

---

<div class="post-metadata">

**Author:** ![whispersofdew](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whispersofdew/32/11067_2.png) [@whispersofdew](https://discuss.elastic.co/u/whispersofdew)\
**Post date:** [January 23, 2017, 3:38pm UTC](https://discuss.elastic.co/t/-default---timestamp-node-js/72489/3 "2017-01-23T15:38:04Z")

</div>

> [@Igor\_Motov](#):
>
> mappings

Помогло!!!  
Но я и эти комбинации пробывал....

В очередной раз огромное спасибо!!!

Начинал именно с mappings но видимо что-то другое не туда подставлял.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 20, 2017, 3:38pm UTC](https://discuss.elastic.co/t/-default---timestamp-node-js/72489/4 "2017-02-20T15:38:13Z")

</div>

Closed on February 20, 2017, 3:38pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
