Deletes one document from the collection

        :param query: dictionary representing the mongo query
        :return: DeleteResult
196624
def delete_one(self, query):
        
        item = self.find_one(query)
        result = self.table.remove(where(u'_id') == item[u'_id'])

        return DeleteResult(raw_result=result)
1029360
def delete(self):
        
        del_query = self._clone()

        # The delete is actually 2 queries - one to find related objects,
        # and one to delete. Make sure that the discovery of related
        # objects is performed on the same database as the deletion.
        del_query._clear_ordering()
        get_es_connection(self.es_url, self.es_kwargs).delete_by_query(self.index, self.type, self._build_query())
        # Clear the result cache, in case this QuerySet gets reused.
        self._result_cache = None
371932
async def delete(self, _id=None):
		
		if not _id:
			return {"error":400, 
					"reason":"Missed required fields"}

		document = await self.collection.find_one({"id": _id})

		if not document:
			return {"error":404, 
					"reason":"Not found"}

		deleted_count = await self.collection.delete_one(
							{"id": _id}).deleted_count

		return deleted_count
331370
public WriteResult<T, K> remove(DBObject query, WriteConcern concern) throws MongoException {
        return new WriteResult<T, K>(this, dbCollection.remove(serializeFields(query), concern));
    }
542302
def remove(self, document):
        
        assert '_id' in document, 'Document must have an id'
        self.db.execute("delete from %s where id = ?" % self.name, (document['_id'],))
78963
def _get_delete_query(self):
        
        foreign = self.get_attribute(self.__foreign_key)

        query = self.new_query().where(self.__foreign_key, foreign)

        return query.where(self.__other_key, self.get_attribute(self.__other_key))
1021401
def destroy(self, request, *args, **kwargs):
        
        obj = self.get_object()
        user = request.user

        if strtobool(request.query_params.get('delete_content', 'false')):
            for data in obj.data.all():
                if user.has_perm('edit_data', data):
                    data.delete()

            # If all data objects in an entity are removed, the entity may
            # have already been removed, so there is no need to call destroy.
            if not Entity.objects.filter(pk=obj.pk).exists():
                return Response(status=status.HTTP_204_NO_CONTENT)

        # NOTE: Collection's ``destroy`` method should be skiped, so we
        # intentionaly call it's parent.
        return super(CollectionViewSet, self).destroy(  # pylint: disable=no-member,bad-super-call
            request, *args, **kwargs
        )
694398
def apply(query, collection=None):
    
    if not collection:
        return query
    result_tree = create_collection_query(collection)
    return AndOp(query, result_tree)
1293999
def delete(self):
        """"""

        assert '_id' in self._document, "Can't delete documents without `_id`"

        # Send delete signal
        signal('delete').send(self.__class__, frames=[self])

        # Delete the document
        self.get_collection().delete_one({'_id': self._id})

        # Send deleted signal
        signal('deleted').send(self.__class__, frames=[self])
1303656
def clear(ctx, schema):
    """"""

    response = _ask('Are you sure you want to delete the collection "%s"' % (
        schema), default='N', data_type='bool')
    if response is True:
        host, port = ctx.obj['dbhost'].split(':')

        client = pymongo.MongoClient(host=host, port=int(port))
        database = client[ctx.obj['dbname']]

        log("Clearing collection for", schema, lvl=warn,
            emitter='MANAGE')
        result = database.drop_collection(schema)
        if not result['ok']:
            log("Could not drop collection:", lvl=error)
            log(result, pretty=True, lvl=error)
        else:
            log("Done")
67535
def delete(
        collection_name, spec, safe, last_error_args, opts, flags=0, ctx=None):
    
    if ctx:
        return _delete_compressed(collection_name, spec, opts, flags, ctx)
    return _delete_uncompressed(
        collection_name, spec, safe, last_error_args, opts, flags)
281798
def delete_search_document(self, *, index):
        """"""
        cache.delete(self.search_document_cache_key)
        get_client().delete(index=index, doc_type=self.search_doc_type, id=self.pk)
694760
def _delete_collection(self, ctx):
        
        assert isinstance(ctx, ResourceQueryContext)

        filter_by = ctx.get_filter_by()
        q = self._orm.query(self.model_cls)

        if filter_by is not None:
            q = self.to_filter(q, filter_by)

        return q.delete()
226581
def delete(self, commit=True):
        

        db.session.delete(self)
        return commit and db.session.commit()
412636
def delete_mongo(database_name, collection_name,
                 query={}, just_one=False):
    """"""

    l = []
    response_dict = {}

    try:
        mongodb_client_url = getattr(settings, 'MONGODB_CLIENT',
                                     'mongodb://localhost:27017/')
        mc = MongoClient(mongodb_client_url, document_class=OrderedDict)
        db = mc[str(database_name)]
        collection = db[str(collection_name)]

        mysearchresult = collection.remove(query, just_one)

        response_dict['code'] = 200
        response_dict['type'] = "remove-confirmation"

    except:
        # print "Error reading from Mongo"
        # print str(sys.exc_info())
        response_dict['num_results'] = 0
        response_dict['code'] = 500
        response_dict['type'] = "Error"
        response_dict['results'] = []
        response_dict['message'] = str(sys.exc_info())
    return response_dict
994480
def delete_collection(self, collection):
        
        uri = str.join('/', [self.uri, collection])
        return self.service._delete(uri)
396396
def delete_gemini_query(self, query_id):
        
        query_obj = self.gemini_query(query_id)
        logger.debug("Delete query: {0}".format(query_obj.name_query))
        self.session.delete(query_obj)
        self.save()