Delete
Delete document from database.
DeleteMixin
¶
Delete document from database.
Source code in src/ramifice/paladins/delete.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
delete(remove_files=True, projection=None, sort=None, hint=None, session=None, let=None, comment=None, **kwargs)
async
¶
Delete document from database.
Agrs
remove_files: True, if need to delete files and images in the public/media/uploads directory.
projection: A list of field names that should be
returned in the result document or a mapping specifying the fields
to include or exclude. If projection is a list "_id" will
always be returned. Use a mapping to exclude fields from
the result (e.g. projection={'_id': False}).
sort: A list of (key, direction) pairs
specifying the sort order for the query. If multiple documents
match the query, they are sorted and the first is deleted.
hint: An index to use to support the query predicate
specified either by its string name, or in the same format as
passed to ~pymongo.asynchronous.collection.AsyncCollection.create_index
(e.g. [('field', ASCENDING)]). This option is only supported
on MongoDB 4.4 and above.
session: A ~pymongo.asynchronous.client_session.AsyncClientSession.
let: Map of parameter names and values. Values must be
constant or closed expressions that do not reference document
fields. Parameters can then be accessed as variables in an
aggregate expression context (e.g. "$$var").
comment: A user-provided comment to attach to this command.
Source code in src/ramifice/paladins/delete.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |