Question: I want get all dates in mycollection in **MongoDb**

**Database Name** is : mydb

**Collection Name**: mycollection

Document1:

```
"Date":"10-01-2020", "timeslot1":"11-12" ,"timeslot2":null ,"timeslot3":null ,"timeslot4":null 

```

Document2:

```
 "Date":"11-01-2020", "timeslot1":null ,"timeslot2":null ,"timeslot3":null ,"timeslot4":null 

```

Document3:

```
 "Date":"14-01-2020", "timeslot1":null ,"timeslot2":null ,"timeslot3":null ,"timeslot4":null

```

I want All dates.I want output like this

```
{10-01-2020, 11-01-2020, 14-01-2020}

```

I am trying this query:

```
x = mydb.mycollection.find({}, {"Date": 1})
  print(x)

```

I get Output like this

```
<pymongo.cursor.Cursor object at 0x000002120610EF98>

```

Answer: 
<https://jsfiddle.net/w0aqvg5m/>

use checked property to toggle in modal hidden event 

`$('#toggle_pump').prop('checked',true)`
It's because you declared 2 ID with same name in that portion.

```
<div class="slider round">
<span class="on" name="add_device_status" id="add_device_status" 
value="Active" autocomplete="off">ON</span>
<span class="off" name="add_device_status" id="add_device_status" 
value="Inactive" autocomplete="off">OFF</span>
</div>

```

Change it to - 

```
<div class="slider round">
<span class="off" name="add_device_status" id="add_device_status" 
value="Active" autocomplete="off">ON</span>
</div>

```

JS- 

```
$("#add_new_device_modal").on('hidden.bs.modal', function(e) {
$('#add_device_status').val("Inactive");
$('#add_device_status').innerHTML = "OFF";
$('#add_device_rule').val("std_pckg");
});

```