If I have a Schema with the key `expires`; how could I get the value of that key to update automatically each time the document is updated? This might be more complicated, but, I am `upsert`ing so this value would need to be set on the initial `insert` and then updated on each `upsert`.

So, when the document is `insert`ed:

```
{
  expires: *an hour from the insert*
}

```

and when it's `update`d (via `upsert`):

```
{
  expires: *an hour from the update*
}

```

I'm using Mongoose if that has this functionality built in. If Mongodb does not support it nor does Mongoose I'll just have to work out the `expires:` and update the value but it would be nice to have this done automagically in Mongodb!

In fact, it would not den *really* need to work on the `insert`; as I could check if the `expires` was empty and extract the time from the `_id`.

As always, any help is greatly appreciated!