Mongodb: skip to insert in db already exist file using python [duplicate]
up vote
0
down vote
favorite
This question already has an answer here:
MongoDB atomic “findOrCreate”: findOne, insert if nonexistent, but do not update
4 answers
How to Ignore Duplicate Key Errors Safely Using insert_many
1 answer
I download the lots of pdfs from the website and want to store in mongo db. but I already having some files in the same collection and want store there which is not there. i tried in python, but its not working.
I tried:
if db.ImportData.find(filename):
db.IEAImportData.insert_one({"Reported_date": reported_date, "FileID": str(pdfid), "LastModifiedDate": datetime.now().isoformat(), "IsProcessed": 0,})
else:
continue
Having "filename" is veriable in which all name of veriable is present.
So please guide me how should i do it
python mongodb
marked as duplicate by Neil Lunn
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 10:20
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
0
down vote
favorite
This question already has an answer here:
MongoDB atomic “findOrCreate”: findOne, insert if nonexistent, but do not update
4 answers
How to Ignore Duplicate Key Errors Safely Using insert_many
1 answer
I download the lots of pdfs from the website and want to store in mongo db. but I already having some files in the same collection and want store there which is not there. i tried in python, but its not working.
I tried:
if db.ImportData.find(filename):
db.IEAImportData.insert_one({"Reported_date": reported_date, "FileID": str(pdfid), "LastModifiedDate": datetime.now().isoformat(), "IsProcessed": 0,})
else:
continue
Having "filename" is veriable in which all name of veriable is present.
So please guide me how should i do it
python mongodb
marked as duplicate by Neil Lunn
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 10:20
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Actually i already seen that question but couldn't understand what exactly they said.So can you please guide regarding my code. I am new in python
– royal
Nov 19 at 10:32
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
MongoDB atomic “findOrCreate”: findOne, insert if nonexistent, but do not update
4 answers
How to Ignore Duplicate Key Errors Safely Using insert_many
1 answer
I download the lots of pdfs from the website and want to store in mongo db. but I already having some files in the same collection and want store there which is not there. i tried in python, but its not working.
I tried:
if db.ImportData.find(filename):
db.IEAImportData.insert_one({"Reported_date": reported_date, "FileID": str(pdfid), "LastModifiedDate": datetime.now().isoformat(), "IsProcessed": 0,})
else:
continue
Having "filename" is veriable in which all name of veriable is present.
So please guide me how should i do it
python mongodb
This question already has an answer here:
MongoDB atomic “findOrCreate”: findOne, insert if nonexistent, but do not update
4 answers
How to Ignore Duplicate Key Errors Safely Using insert_many
1 answer
I download the lots of pdfs from the website and want to store in mongo db. but I already having some files in the same collection and want store there which is not there. i tried in python, but its not working.
I tried:
if db.ImportData.find(filename):
db.IEAImportData.insert_one({"Reported_date": reported_date, "FileID": str(pdfid), "LastModifiedDate": datetime.now().isoformat(), "IsProcessed": 0,})
else:
continue
Having "filename" is veriable in which all name of veriable is present.
So please guide me how should i do it
This question already has an answer here:
MongoDB atomic “findOrCreate”: findOne, insert if nonexistent, but do not update
4 answers
How to Ignore Duplicate Key Errors Safely Using insert_many
1 answer
python mongodb
python mongodb
asked Nov 19 at 10:18
royal
178
178
marked as duplicate by Neil Lunn
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 10:20
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Neil Lunn
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 10:20
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Actually i already seen that question but couldn't understand what exactly they said.So can you please guide regarding my code. I am new in python
– royal
Nov 19 at 10:32
add a comment |
Actually i already seen that question but couldn't understand what exactly they said.So can you please guide regarding my code. I am new in python
– royal
Nov 19 at 10:32
Actually i already seen that question but couldn't understand what exactly they said.So can you please guide regarding my code. I am new in python
– royal
Nov 19 at 10:32
Actually i already seen that question but couldn't understand what exactly they said.So can you please guide regarding my code. I am new in python
– royal
Nov 19 at 10:32
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Actually i already seen that question but couldn't understand what exactly they said.So can you please guide regarding my code. I am new in python
– royal
Nov 19 at 10:32