You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
674 B
Python
21 lines
674 B
Python
# -*- coding: utf-8 -*-
|
|
# @Time : 2026/1/13 14:54
|
|
# @Author : zhaoxiangpeng
|
|
# @File : test_item_exists.py
|
|
|
|
from pymongo import MongoClient
|
|
from pymongo.database import Database
|
|
from pymongo.collection import Collection
|
|
from science_article_cnki.db_utils.mongo import MongoDBUtils
|
|
from science_article_cnki.settings import MONGO_URI, MONGO_DATABASE
|
|
|
|
client: MongoClient = MongoClient(MONGO_URI)
|
|
db: Database = client[MONGO_DATABASE]
|
|
|
|
|
|
def test_item_exists():
|
|
collection: Collection = db.get_collection('data_cnki_article')
|
|
results = collection.find_one(filter={"third_id": {"$in": ['SCJI202502004']}}, projection={"_id": 0, "third_id": 1})
|
|
print(results)
|
|
|