Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Peter Otten <__peter__@web.de> Newsgroups: comp.lang.python Subject: Re: Unable to insert data into MongoDB. Date: Mon, 15 Feb 2016 12:36:17 +0100 Organization: None Lines: 18 Message-ID: References: <8bb40e3f-57ce-4d5a-a426-6b56cebc8de7@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de rLUdNuGA3DFgP+fR1yyPyAKFN2gpLaTbJT4YXL8fb8ng== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'debug': 0.04; 'scripts': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'scripts,': 0.09; 'subject:into': 0.09; 'made-up': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'wrote:': 0.16; 'changes': 0.20; 'script': 0.25; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'actual': 0.28; 'another.': 0.29; 'print': 0.30; 'code': 0.30; 'changed': 0.33; 'machine.': 0.33; 'server': 0.34; 'replace': 0.35; 'instead': 0.36; 'data.': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'received:org': 0.37; '(2)': 0.37; '(1)': 0.38; 'data': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'your': 0.60; 'hope': 0.61; 'sample': 0.63; 'satisfaction': 0.72 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: p57bd81b4.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102960 Arjun Srivatsa wrote: > I changed the port number from 27017 to 55555 in the code segment: Instead of throwing arbitrary changes at your script in the hope that one works I recommend that you write two independent scripts, from scratch: (1) write_to_db.py: Write made-up data into the MongoDB on your local machine. (2) read_from_server.py: Read data from the server and print it to stdout. Reduce these scripts to the bare minimum. Debug them one ofter another. Once both scripts work to your satisfaction replace the sample data in script one with code from script two that reads actual data.