Skip to content

Commit

Permalink
reorder filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
lfunderburk committed Nov 16, 2023
1 parent 8619b04 commit eab9b61
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions ch3/jupyter-notebooks/components.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,30 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 53,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filters_df = {\n",
" \"dataframe.age\": {\"$eq\": 35}\n",
"}\n",
"docstore.filter_documents(filters=filters_df)\n"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {},
"outputs": [
{
Expand All @@ -232,16 +255,16 @@
" Document(id='4', content=None, dataframe=None, blob=ByteStream(data=b'Your binary data here', metadata={}, mime_type='application/pdf'), meta={'file_name': 'example.pdf', 'file_type': 'PDF'}, score=None)]"
]
},
"execution_count": 45,
"execution_count": 54,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filters_exact_match = {\n",
"filters_none = {\n",
" \"content\": {\"$eq\": None}\n",
"}\n",
"docstore.filter_documents(filters=filters_exact_match)\n"
"docstore.filter_documents(filters=filters_none)\n"
]
},
{
Expand Down

0 comments on commit eab9b61

Please sign in to comment.