I have collection called Store like so:

```
    @Document("Store")
    public class Store implements Persistable<String> {

        @Id
        private String storeNum;

        private String publicHealthUnit;

        private List<RestrictionTracker> restrictionTracker;
}

```

The embedded doc restrictriction tracker looks like this:

```
public class RestrictionTracker {

    private int dailyCapRunningTotal;

    private int weeklyCapRunningTotal;
}

```

I'm trying to create a scheduled trigger that sets all the values of **dailyCapRunningTotal** field to 0 in every **RestrictionTracker** embedded doc for every single document in **Store** Collection - every 24 hours starting at 12PM EST (I will configure the cron expression in GMT)

I'm trying to use the following query:

```
collection.updateMany(

 {},

 { $set: {"restrictionTracker.dailyCapRunningTotal":0}}

 );

```

There is a document in the store collection which has a list of RestrictionTrackers with 2 documents in them - that have dailyCapRunningTotal fields set to 30 and 50

when I run the above mentioned query I get the following error:

> 
> uncaught promise rejection: multiple write errors: [{write errors:
> [{Cannot create field 'dailyCapRunningTotal' in element
> {restrictionTracker: [ { dailyCapRunningTotal: 30 }, {
> dailyCapRunningTotal: 50 } ]}}]}, {}]
> 
> 
> 

Seems to me like its trying to create a new field with value 0 instead of replacing the existing values

Not sure what the issue is with the syntax as I'm using the queries provided in the following online manual: <https://www.mongodbtutorial.org/mongodb-crud/mongodb-updatemany/>

Any help would be appreciated. Thanks.