Dear all Mongodb have support JS function like store procedure, function in SQL Server. Does Mongodb have to support Job Schedule? How do you do on it?
1) You should avoid using MongoDB stored JavaScript procedures if you possibly can. The JavaScript engine is single-threaded. If you run critical processes using the JavaScript stored procedures you are likely to have performance problems.
2) MongoDB currently does not have any ability to schedule any tasks to run. There is an existing SERVER ticket with a request to add this functionality. You can follow this ticket and vote it up here: https://jira.mongodb.org/browse/SERVER-2573
3) If you want to schedule a task to run in MongoDB, the best way to do this is with the operating system scheduler. For example, 'cron' on Unix/Linux.
On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:
> Dear all > Mongodb have support JS function like store procedure, function in SQL > Server. Does Mongodb have to support Job Schedule? How do you do on it?
Hi William
1) As your guide, I should not use Stored JavaScript Procedures on MongoDB.
I have to execute JavaScript file on Mongo Client.
2) You said that the JavaScript engine is single-threaded. That's
mean MongoDB will be write locked when this script have not been finished.
Could you give me document introduce about them?
> 1) You should avoid using MongoDB stored JavaScript procedures if you
> possibly can. The JavaScript engine is single-threaded. If you run
> critical processes using the JavaScript stored procedures you are likely to
> have performance problems.
> 2) MongoDB currently does not have any ability to schedule any tasks to
> run. There is an existing SERVER ticket with a request to add this
> functionality. You can follow this ticket and vote it up here:
> https://jira.mongodb.org/browse/SERVER-2573
> 3) If you want to schedule a task to run in MongoDB, the best way to do
> this is with the operating system scheduler. For example, 'cron' on
> Unix/Linux.
> Have a great day!
> -William
> On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:
>> Dear all
>> Mongodb have support JS function like store procedure, function in SQL
>> Server. Does Mongodb have to support Job Schedule? How do you do on it?
>> Thanks and Regards.
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
--
Thanks and Best Regards
--------------------------------------------------------------------------- ----------------------------------
*Tom Vo*
> Hi William
> 1) As your guide, I should not use Stored JavaScript Procedures on
> MongoDB. I have to execute JavaScript file on Mongo Client.
> 2) You said that the JavaScript engine is single-threaded. That's
> mean MongoDB will be write locked when this script have not been finished.
> Could you give me document introduce about them?
> On Wed, Oct 3, 2012 at 11:58 PM, William Zola <william.z...@10gen.com>wrote:
>> Hi Tom!
>> 1) You should avoid using MongoDB stored JavaScript procedures if you
>> possibly can. The JavaScript engine is single-threaded. If you run
>> critical processes using the JavaScript stored procedures you are likely to
>> have performance problems.
>> 2) MongoDB currently does not have any ability to schedule any tasks to
>> run. There is an existing SERVER ticket with a request to add this
>> functionality. You can follow this ticket and vote it up here:
>> https://jira.mongodb.org/browse/SERVER-2573
>> 3) If you want to schedule a task to run in MongoDB, the best way to do
>> this is with the operating system scheduler. For example, 'cron' on
>> Unix/Linux.
>> Have a great day!
>> -William
>> On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:
>>> Dear all
>>> Mongodb have support JS function like store procedure, function in SQL
>>> Server. Does Mongodb have to support Job Schedule? How do you do on it?
>>> Thanks and Regards.
>> --
>> You received this message because you are subscribed to the Google
>> Groups "mongodb-user" group.
>> To post to this group, send email to mongodb-user@googlegroups.com
>> To unsubscribe from this group, send email to
>> mongodb-user+unsubscribe@googlegroups.com
>> See also the IRC channel -- freenode.net#mongodb
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
On Thu, Oct 4, 2012 at 3:58 PM, Sam Millman <sam.mill...@gmail.com> wrote:
> Server-side execution will lock yes.
> I am unsure why you need to run a file in the mongo client application
> from your own server side application.
> Why can you not run this from your application directly?
> On 4 October 2012 03:45, Tom Vo <tom...@nexcel.vn> wrote:
>> Hi William
>> 1) As your guide, I should not use Stored JavaScript Procedures on
>> MongoDB. I have to execute JavaScript file on Mongo Client.
>> 2) You said that the JavaScript engine is single-threaded. That's
>> mean MongoDB will be write locked when this script have not been finished.
>> Could you give me document introduce about them?
>> On Wed, Oct 3, 2012 at 11:58 PM, William Zola <william.z...@10gen.com>wrote:
>>> Hi Tom!
>>> 1) You should avoid using MongoDB stored JavaScript procedures if you
>>> possibly can. The JavaScript engine is single-threaded. If you run
>>> critical processes using the JavaScript stored procedures you are likely to
>>> have performance problems.
>>> 2) MongoDB currently does not have any ability to schedule any tasks to
>>> run. There is an existing SERVER ticket with a request to add this
>>> functionality. You can follow this ticket and vote it up here:
>>> https://jira.mongodb.org/browse/SERVER-2573
>>> 3) If you want to schedule a task to run in MongoDB, the best way to do
>>> this is with the operating system scheduler. For example, 'cron' on
>>> Unix/Linux.
>>> Have a great day!
>>> -William
>>> On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:
>>>> Dear all
>>>> Mongodb have support JS function like store procedure, function in SQL
>>>> Server. Does Mongodb have to support Job Schedule? How do you do on it?
>>>> Thanks and Regards.
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "mongodb-user" group.
>>> To post to this group, send email to mongodb-user@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> mongodb-user+unsubscribe@googlegroups.com
>>> See also the IRC channel -- freenode.net#mongodb
>> --
>> You received this message because you are subscribed to the Google
>> Groups "mongodb-user" group.
>> To post to this group, send email to mongodb-user@googlegroups.com
>> To unsubscribe from this group, send email to
>> mongodb-user+unsubscribe@googlegroups.com
>> See also the IRC channel -- freenode.net#mongodb
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
--
Thanks and Best Regards
--------------------------------------------------------------------------- ----------------------------------
*TOM*
> I need summary data from some collections and insert to other
> collection. I setup Mongodb on Windows Server 2008 and used to Task
> Schedule to run it.
> On Thu, Oct 4, 2012 at 3:58 PM, Sam Millman <sam.mill...@gmail.com> wrote:
>> Server-side execution will lock yes.
>> I am unsure why you need to run a file in the mongo client application
>> from your own server side application.
>> Why can you not run this from your application directly?
>> On 4 October 2012 03:45, Tom Vo <tom...@nexcel.vn> wrote:
>>> Hi William
>>> 1) As your guide, I should not use Stored JavaScript Procedures on
>>> MongoDB. I have to execute JavaScript file on Mongo Client.
>>> 2) You said that the JavaScript engine is single-threaded. That's
>>> mean MongoDB will be write locked when this script have not been finished.
>>> Could you give me document introduce about them?
>>> On Wed, Oct 3, 2012 at 11:58 PM, William Zola <william.z...@10gen.com>wrote:
>>>> Hi Tom!
>>>> 1) You should avoid using MongoDB stored JavaScript procedures if you
>>>> possibly can. The JavaScript engine is single-threaded. If you run
>>>> critical processes using the JavaScript stored procedures you are likely to
>>>> have performance problems.
>>>> 2) MongoDB currently does not have any ability to schedule any tasks to
>>>> run. There is an existing SERVER ticket with a request to add this
>>>> functionality. You can follow this ticket and vote it up here:
>>>> https://jira.mongodb.org/browse/SERVER-2573
>>>> 3) If you want to schedule a task to run in MongoDB, the best way to do
>>>> this is with the operating system scheduler. For example, 'cron' on
>>>> Unix/Linux.
>>>> Have a great day!
>>>> -William
>>>> On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:
>>>>> Dear all
>>>>> Mongodb have support JS function like store procedure, function in SQL
>>>>> Server. Does Mongodb have to support Job Schedule? How do you do on it?
>>>>> Thanks and Regards.
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "mongodb-user" group.
>>>> To post to this group, send email to mongodb-user@googlegroups.com
>>>> To unsubscribe from this group, send email to
>>>> mongodb-user+unsubscribe@googlegroups.com
>>>> See also the IRC channel -- freenode.net#mongodb
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "mongodb-user" group.
>>> To post to this group, send email to mongodb-user@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> mongodb-user+unsubscribe@googlegroups.com
>>> See also the IRC channel -- freenode.net#mongodb
>> --
>> You received this message because you are subscribed to the Google
>> Groups "mongodb-user" group.
>> To post to this group, send email to mongodb-user@googlegroups.com
>> To unsubscribe from this group, send email to
>> mongodb-user+unsubscribe@googlegroups.com
>> See also the IRC channel -- freenode.net#mongodb
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
1) The JavaScript engine does not take a read lock or a write lock. There is a separate JavaScript lock. You can have multiple readers or writers while a JavaScript thread is executing, but you cannot have two threads using JavaScript running at the same time.
This is not a limitation of MongoDB. This is a limitation of the SpiderMonkey JavaScript engine that MongoDB uses.
On Thursday, October 4, 2012 2:12:33 AM UTC-7, Tom Vo wrote:
> Hi Wiliam
> I need summary data from some collections and insert to other > collection. I setup Mongodb on Windows Server 2008 and used to Task > Schedule to run it.
> On Thu, Oct 4, 2012 at 3:58 PM, Sam Millman <sam.m...@gmail.com<javascript:> > > wrote:
>> Server-side execution will lock yes.
>> I am unsure why you need to run a file in the mongo client application >> from your own server side application.
>> Why can you not run this from your application directly?
>> On 4 October 2012 03:45, Tom Vo <tom...@nexcel.vn <javascript:>> wrote:
>>> Hi William >>> 1) As your guide, I should not use Stored JavaScript Procedures on >>> MongoDB. I have to execute JavaScript file on Mongo Client.
>>> 2) You said that the JavaScript engine is single-threaded. That's >>> mean MongoDB will be write locked when this script have not been finished. >>> Could you give me document introduce about them?
>>> On Wed, Oct 3, 2012 at 11:58 PM, William Zola <willia...@10gen.com<javascript:> >>> > wrote:
>>>> Hi Tom!
>>>> 1) You should avoid using MongoDB stored JavaScript procedures if you >>>> possibly can. The JavaScript engine is single-threaded. If you run >>>> critical processes using the JavaScript stored procedures you are likely to >>>> have performance problems.
>>>> 2) MongoDB currently does not have any ability to schedule any tasks to >>>> run. There is an existing SERVER ticket with a request to add this >>>> functionality. You can follow this ticket and vote it up here: >>>> https://jira.mongodb.org/browse/SERVER-2573
>>>> 3) If you want to schedule a task to run in MongoDB, the best way to do >>>> this is with the operating system scheduler. For example, 'cron' on >>>> Unix/Linux.
>>>> Have a great day!
>>>> -William
>>>> On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:
>>>>> Dear all >>>>> Mongodb have support JS function like store procedure, function in SQL >>>>> Server. Does Mongodb have to support Job Schedule? How do you do on it?
>>>>> Thanks and Regards.
>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "mongodb-user" group. >>>> To post to this group, send email to mongod...@googlegroups.com<javascript:> >>>> To unsubscribe from this group, send email to >>>> mongodb-user...@googlegroups.com <javascript:> >>>> See also the IRC channel -- freenode.net#mongodb
>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "mongodb-user" group. >>> To post to this group, send email to mongod...@googlegroups.com<javascript:> >>> To unsubscribe from this group, send email to >>> mongodb-user...@googlegroups.com <javascript:> >>> See also the IRC channel -- freenode.net#mongodb
>> -- >> You received this message because you are subscribed to the Google >> Groups "mongodb-user" group. >> To post to this group, send email to mongod...@googlegroups.com<javascript:> >> To unsubscribe from this group, send email to >> mongodb-user...@googlegroups.com <javascript:> >> See also the IRC channel -- freenode.net#mongodb
> 1) The JavaScript engine does not take a read lock or a write lock. There
> is a separate JavaScript lock. You can have multiple readers or writers
> while a JavaScript thread is executing, but you cannot have two threads
> using JavaScript running at the same time.
> This is not a limitation of MongoDB. This is a limitation of the
> SpiderMonkey JavaScript engine that MongoDB uses.
> If your JavaScript code reads or writes to the database, then -- and only
> then -- will it take a read lock or write lock, as necessary.
> 2) If you need to run regular scheduled jobs, then running them with Task
> Scheduler is a good way to do it.
> Let me know if you have further questions. Have a great day!
> -William
> On Thursday, October 4, 2012 2:12:33 AM UTC-7, Tom Vo wrote:
>> Hi Wiliam
>> I need summary data from some collections and insert to other
>> collection. I setup Mongodb on Windows Server 2008 and used to Task
>> Schedule to run it.
>> On Thu, Oct 4, 2012 at 3:58 PM, Sam Millman <sam.m...@gmail.com> wrote:
>>> Server-side execution will lock yes.
>>> I am unsure why you need to run a file in the mongo client application
>>> from your own server side application.
>>> Why can you not run this from your application directly?
>>> On 4 October 2012 03:45, Tom Vo <tom...@nexcel.vn> wrote:
>>>> Hi William
>>>> 1) As your guide, I should not use Stored JavaScript Procedures on
>>>> MongoDB. I have to execute JavaScript file on Mongo Client.
>>>> 2) You said that the JavaScript engine is single-threaded. That's
>>>> mean MongoDB will be write locked when this script have not been finished.
>>>> Could you give me document introduce about them?
>>>> Thank you for your reply and kindly supports.
>>>> On Wed, Oct 3, 2012 at 11:58 PM, William Zola <willia...@10gen.com>wrote:
>>>>> Hi Tom!
>>>>> 1) You should avoid using MongoDB stored JavaScript procedures if you
>>>>> possibly can. The JavaScript engine is single-threaded. If you run
>>>>> critical processes using the JavaScript stored procedures you are likely to
>>>>> have performance problems.
>>>>> 3) If you want to schedule a task to run in MongoDB, the best way to
>>>>> do this is with the operating system scheduler. For example, 'cron' on
>>>>> Unix/Linux.
>>>>> Have a great day!
>>>>> -William
>>>>> On Tuesday, October 2, 2012 7:43:52 PM UTC-7, Tom Vo wrote:
>>>>>> Dear all
>>>>>> Mongodb have support JS function like store procedure, function in
>>>>>> SQL Server. Does Mongodb have to support Job Schedule? How do you do on it?
>>>>>> Thanks and Regards.
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "mongodb-user" group.
>>>>> To post to this group, send email to mongod...@googlegroups.com
>>>>> To unsubscribe from this group, send email to
>>>>> mongodb-user...@**googlegroups.com
>>>>> See also the IRC channel -- freenode.net#mongodb
>>>> --
>>>> Thanks and Best Regards
>>>> ------------------------------**------------------------------**
>>>> ------------------------------**-------------------
>>>> *Tom Vo*
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "mongodb-user" group.
>>>> To post to this group, send email to mongod...@googlegroups.com
>>>> To unsubscribe from this group, send email to
>>>> mongodb-user...@**googlegroups.com
>>>> See also the IRC channel -- freenode.net#mongodb
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "mongodb-user" group.
>>> To post to this group, send email to mongod...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> mongodb-user...@**googlegroups.com
>>> See also the IRC channel -- freenode.net#mongodb
>> --
>> Thanks and Best Regards
>> ------------------------------**------------------------------**
>> ------------------------------**-------------------
>> *TOM*
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
--
Thanks and Best Regards
--------------------------------------------------------------------------- ----------------------------------
*TOM Vo*