summaryrefslogtreecommitdiff
path: root/src/mango/src/mango.hrl
blob: 2ff07aa4b7ec1939131c755074d331b575e0b24d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
% License for the specific language governing permissions and limitations under
% the License.

-define(MANGO_ERROR(R), throw({mango_error, ?MODULE, R})).

-type maybe(A) :: A | undefined.

-type abstract_text_selector() :: {'op_and', [abstract_text_selector()]}
				| {'op_or', [abstract_text_selector()]}
				| {'op_not', {abstract_text_selector(), abstract_text_selector()}}
				| {'op_not', {_, 'false'}}
				| {'op_field', {iolist() | binary(), _}}
				| {'op_fieldname', {_, _}}
				| {'op_null', {_, _}}
				| {'op_default', _}
				| {'op_regex', binary()}.

-type database() :: binary().
-type field() :: binary().
-type fields() :: all_fields | [field()].
-type selector() :: any().
-type ejson() :: {[{atom(), any()}]}.

-type shard_stats() :: {docs_examined, non_neg_integer()}.
-type row_property_key() :: id | key | value | doc.
-type row_properties() :: [{row_property_key(), any()}].