﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Rohland, 
That is an excellent suggestion!</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment29</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment29</guid><pubDate>Wed, 25 Jul 2012 03:50:09 GMT</pubDate></item><item><title>Ayende Rahien commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Matt,
The _purpose_ of this feature is to allow arbitrary code execution on the server.
Now, there are safeguards there that make _really_ hard to do BAD THINGS, but the whole point is to allow the user great level of freedom in how they patch the document.
We support variables, so that you don't have to do things using string concat.
Beyond that, it is the user responsibility to clean up their input.
</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment28</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment28</guid><pubDate>Wed, 25 Jul 2012 03:49:21 GMT</pubDate></item><item><title>Beyers commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>@Matt

Once you implement the strongly typed C# api people will be able to thank you for LINQ-to-JAVASCRIPT :)</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment27</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment27</guid><pubDate>Wed, 25 Jul 2012 00:21:41 GMT</pubDate></item><item><title>Michael Chandler commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Matt, awesome, that was my second train of thought.</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment26</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment26</guid><pubDate>Wed, 25 Jul 2012 00:05:55 GMT</pubDate></item><item><title>Matt Warren commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>@Damien

Unfortunately no, I'm not that Matt Warren. I wish I was though, writing LINQ-to-SQL and working on the C# Compiler team would be pretty cool.

I have got mistaken for him on SO a few times though!! People have thanked me for LINQ-to-SQL!!!!</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment25</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment25</guid><pubDate>Tue, 24 Jul 2012 21:26:53 GMT</pubDate></item><item><title>Rohland commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Nice work. 

Perhaps the name 'ScriptedPatchRequest' is more suitable? 'AdvancedScriptRequest' is rather limiting given the pace of development ;)</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment24</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment24</guid><pubDate>Tue, 24 Jul 2012 20:29:04 GMT</pubDate></item><item><title>Damien Guard commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Not to be confused with the Matt Warren that wrote LINQ to SQL and IQToolkit...</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment23</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment23</guid><pubDate>Tue, 24 Jul 2012 20:15:50 GMT</pubDate></item><item><title>Matt Warren commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>@Matt

What you can do inside the script is pretty constrained. For instance, you only have basic JavaScript functions, plus a few helpers RavenDB injects for you. 

Also you are only given access to the Json version of a doc, nothing else.</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment22</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment22</guid><pubDate>Tue, 24 Jul 2012 15:55:51 GMT</pubDate></item><item><title>Matt Johnson commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Really cool, but is there a security risk here? I see that input values are parameratized to prevented attacks similar to SQL injection, although I suppose a developer could screw that up with string concatenation when building their script if they wanted to.

How well does the underlying HTTP command encapsulate the script to prevent other types of escaping?  I wouldn't want someone to be able to find a magic escape sequence that lets them enter random javascript into a field and have it executed in the patch command.</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment21</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment21</guid><pubDate>Tue, 24 Jul 2012 15:37:26 GMT</pubDate></item><item><title>Ayende Rahien commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Andres,
Go and compare a CouchDB view to RavenDB index, then tell me you want to write it in JS</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment20</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment20</guid><pubDate>Tue, 24 Jul 2012 14:43:19 GMT</pubDate></item><item><title>Andres commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>When RavenDb index also is indexing Json docs.</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment19</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment19</guid><pubDate>Tue, 24 Jul 2012 14:40:07 GMT</pubDate></item><item><title>Matt Warren commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>@Michael, @Anders

I've got plans to implement a strongly typed C# api, with LINQ/lambdas, that would then produce the JavaScript for you. But it'll be a while before it's available. 

Plus JavaScript is a nice fit in this case, because your're editing Json docs.</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment18</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment18</guid><pubDate>Tue, 24 Jul 2012 14:02:21 GMT</pubDate></item><item><title>Andres commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Michael +1

It could be great if you use the same approach / language than index definitions: All Javascript or all .NET or Linq</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment17</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment17</guid><pubDate>Tue, 24 Jul 2012 13:26:19 GMT</pubDate></item><item><title>Ayende Rahien commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Michael,
Between different machines?
So the server now depends on the client?
And you can't easily limit what they can do.</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment16</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment16</guid><pubDate>Tue, 24 Jul 2012 12:01:08 GMT</pubDate></item><item><title>Michael Chandler commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Ayende, you would need to serialize/deserialize the delegate (I don't know what the feasibility of doing this is). In terms of the code, presumably you could sandbox or limit it to certain calls. What context does the IronJS script run under?

I wasn't thinking about the technical implementation, but more so what the API could look like... maybe something like: 
Script = (Doc doc) =&gt; { 
   doc.FullName = doc.FirstName + " " + doc.LastName; 
   Remove.Property(() =&gt; doc.FirstName);
   Remove.Property(() =&gt; doc.LastName);
})


Just thinking out loud...:)

</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment15</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment15</guid><pubDate>Tue, 24 Jul 2012 11:55:56 GMT</pubDate></item><item><title>Ayende Rahien commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Rob,
All of those new features are going into the 1.2 version, which we expect will be out in a few months in a stable version.
Once that is done, RavenHQ will start doing their own internal testing &amp; rollout.</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment14</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment14</guid><pubDate>Tue, 24 Jul 2012 11:30:47 GMT</pubDate></item><item><title>Rob commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Very cool. I have some uses I can think of. As you announce new features here, I've been wondering: what's the best way to know when a particular feature is supported on RavenHQ?</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment13</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment13</guid><pubDate>Tue, 24 Jul 2012 11:25:26 GMT</pubDate></item><item><title>Andreas Kroll commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Awesome!

If this is not even the cool stuff as Ayende said, I just cannot wait until the follow-up post... 

It's really just like magic to send javascript to a database to patch documents. This makes nearly all of my version migration concerns just ease away... :-)

RavenDB just gets better and better.... and.... to quote Ayende: 

       "It just works...." :-)

You Sir, put a big smile on my face today... </description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment12</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment12</guid><pubDate>Tue, 24 Jul 2012 11:25:00 GMT</pubDate></item><item><title>Ayende Rahien commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Michael,
What happens when you are running on a remote server?
What happens if I don't WANT you to execute random unverifable code on my server?</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment11</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment11</guid><pubDate>Tue, 24 Jul 2012 10:53:24 GMT</pubDate></item><item><title>Michael Chandler commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Very cool.

I wonder if you could use something like Deleporter to do it in C# instead of JS?

http://blog.stevensanderson.com/2010/03/09/deleporter-cross-process-code-injection-for-aspnet/</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment10</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment10</guid><pubDate>Tue, 24 Jul 2012 10:40:57 GMT</pubDate></item><item><title>Rafal commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Great, I was wondering how long will it be before RavenDB has a javascript interpreter.</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment9</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment9</guid><pubDate>Tue, 24 Jul 2012 10:28:36 GMT</pubDate></item><item><title>Matt Warren commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>BTW, this means that RavenDB now is part of the NoSQL "cool-gang", it has an embedded JavaScript interpreter!!!!</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment8</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment8</guid><pubDate>Tue, 24 Jul 2012 09:35:12 GMT</pubDate></item><item><title>Matt Warren commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>@Ender, it's using IronJS (https://github.com/fholm/IronJS/) to do this</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment7</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment7</guid><pubDate>Tue, 24 Jul 2012 09:25:55 GMT</pubDate></item><item><title>Ayende Rahien commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>jhovgaard ,
This is in the 203x and up builds, I think
Suggest a way to do that from the studio.
</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment6</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment6</guid><pubDate>Tue, 24 Jul 2012 09:25:41 GMT</pubDate></item><item><title>Ayende Rahien commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>Ender,
IronJS</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment5</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment5</guid><pubDate>Tue, 24 Jul 2012 09:25:13 GMT</pubDate></item><item><title>jhovgaard commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>This is very nice! Starting from which version is this possible?

Btw, is there any plans on adding the ability to bulk modify documents directly from the Studio? It's very inconvenient that we need to write code (and compile it) to do "bigger" changes.

Thanks!
jhovgaard</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment4</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment4</guid><pubDate>Tue, 24 Jul 2012 09:18:54 GMT</pubDate></item><item><title>Frank Quednau commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>The really cool part must be the ability to send a *.patch file :)</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment3</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment3</guid><pubDate>Tue, 24 Jul 2012 09:18:00 GMT</pubDate></item><item><title>Ender commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>What is RavenDB using to interpret JavaScript?</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment2</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment2</guid><pubDate>Tue, 24 Jul 2012 09:17:36 GMT</pubDate></item><item><title>Phillip Haydon commented on Awesome RavenDB Feature of the day:  Evil Patching</title><description>New API changes for patching are so hot.
</description><link>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment1</link><guid>http://ayende.com/157185/awesome-ravendb-feature-of-the-day-evil-patching#comment1</guid><pubDate>Tue, 24 Jul 2012 09:15:44 GMT</pubDate></item></channel></rss>