title: TypeError update() got multiple values for argument 'upsert' with $setOnInsert
body: <p>I am trying to scan through the file system for files - if the file is in the DB then update. If not then insert a new record. but I am getting this error "TypeError update() got multiple values for argument 'upsert'" </p>
  
  <p>What am I doing wrong here? </p>
  
  <pre><code>def scan_for_file(dir_path, storage_bucket):
      for file in os.listdir(dir_path):
          curpath = os.path.join(dir_path, file)
          if os.path.isfile(curpath):
              print('found file:', file)
              print('checking db')
              collection = db.file_collection
              cursor = collection.find({'file_path': curpath})
              for document in cursor:
                  file_db_id = document['_id']
                  file_accessed = datetime.datetime.fromtimestamp(os.path.getatime(curpath))
                  file_modified = datetime.datetime.fromtimestamp(os.path.getmtime(curpath))
                  file_created = datetime.datetime.fromtimestamp(os.path.getctime(curpath))
                  file_size = os.stat(curpath).st_size
                  file_convert_size = convert_size(file_size)
                  utc_datetime = datetime.datetime.utcnow()
                  update_id = collection.update_one({'_id': file_db_id}, {
                      "$set": {
                      "file_size": file_convert_size,
                      "file_size_bytes": file_size,
                      "process_datestamp": utc_datetime.strftime("%Y-%m-%d %H:%M:%S"),
                      "file_created": file_created,
                      "file_accessed": file_accessed,
                      "file_modified": file_modified}},
                      {
                      "$setOnInsert": {
                      "file_path": curpath,
                      "file_name": file,
                      "file_size": file_convert_size,
                      "file_size_bytes": file_size,
                      "process_datestamp": utc_datetime.strftime("%Y-%m-%d %H:%M:%S"),
                      "file_$reated": file_created,
                      "file_accessed": file_accessed,
                      "file_modified": file_modified}}, upsert=True,
                                                    )
                  update_id
                  print('ID Updated:', file_db_id)
                  print('updating document id:')
          else:
              print('This is not a file:', file)
  </code></pre>