Question: I'm using angular's getLocaleDateTimeFormat function to display selected date-time in the input field.

`getLocaleDateTimeFormat(this.injector.get(LOCALE_ID), FormatWidth.Short)` function shows `{1}, {0}`

but when i use  

`getLocaleDateFormat(this.injector.get(LOCALE_ID), FormatWidth.Short)` and `getLocaleTimeFormat(this.injector.get(LOCALE_ID), FormatWidth.Short)` each separately they display date and time properly.

Am i doing something wrong?

My function is:

`
formattingDate(date: Date): string {

```
if (!date || typeof date == 'string') {
    return '';
}

let localeId = this.injector.get(LOCALE_ID);

let localeDateFormat = getLocaleDateFormat(localeId, FormatWidth.Short);
let localeTimeFormat = getLocaleTimeFormat(localeId, FormatWidth.Short);
let localeDateTimeFormat = getLocaleDateTimeFormat(localeId, FormatWidth.Short);
return formatDate(date, localeDateTimeFormat, localeId);

```

}
`

the thing is getLocaleDateTimeFormat function is not getting date or time or both from date argument

Answer: 
MongoDB is very fast in the execution of queries. But it also depends on how you write your query. For getting the first 10 documents and sort it descending order to the \_id from a collection. You need to use `limit` & `sort` in your query.

```
db.collectionName.find({}).limit(10).sort({_id:-1})

```
Make sure it's not a connection issue. Try to run your query from MongoDB shell

```
mongo mongodb+srv://${process.env.MONGO_USER}:${process.env.MONGO_PASSWORD}@cluster0-vuauc.mongodb.net/${process.env.MONGO_DB}?retryWrites=true&w=majority
db.collection.find({condition}).limit(10)

```

If in MongoDB shell it responds *faster* than Mongoose:

There is an issue for `Node.js` driver which uses pure Javascript [BSON serializer](https://stackoverflow.com/questions/36767310/why-is-json-faster-than-bson-in-node-js) which is very slow to serialize from BSON to JSON. 

Try to install `bson-ext`

> 
> The `bson-ext` module is an alternative BSON parser that is written in `C++`. It delivers **better deserialization performance** and similar or somewhat better serialization performance to the pure javascript parser.
> 
> 
> 

<https://mongodb.github.io/node-mongodb-native/3.5/installation-guide/installation-guide/#bson-ext-module>