                     guard document["doc"].exists() else {
                         throw AdapterError.internalError("Missing document content")
                     }
-                    let model = try <%- model.classname %>(json: document["doc"])
+                    var modelJSON = document["doc"]
+                    _ = modelJSON.dictionaryObject?.removeValue(forKey: "_id")
+                    _ = modelJSON.dictionaryObject?.removeValue(forKey: "_rev")
+                    let model = try <%- model.classname %>(json: modelJSON)
                     return model.settingID(docid)
                 }
                 onCompletion(models, nil)

                    return
                }
                do {
                    let model = try <%- model.classname %>(json: document)
                    onCompletion(model.settingID(docid), nil)
                } catch {
                    onCompletion(nil, AdapterError.internalError(String(describing: error)))

            }

            do {
                var modelJSON = document
                _ = modelJSON.dictionaryObject?.removeValue(forKey: "_id")
                _ = modelJSON.dictionaryObject?.removeValue(forKey: "_rev")
                let model = try <%- model.classname %>(json: modelJSON)
                onCompletion(model.settingID(docid), nil)
            } catch {
                onCompletion(nil, AdapterError.internalError(String(describing: error)))
