import json
import pymongo
from redis import StrictRedis
rediscli=StrictRedis(host='192.168.6.223',port=6379,db=0,decode_responses=True)
client=pymongo.MongoClient('mongoip',27017)
db=client.xixian
collention=db.demo
while True:
source, data = rediscli.blpop(["jincai_data:items"])
item = json.loads(data)
collention.insert_one(item)
print(item)